Overview
Last updated
Was this helpful?
Last updated
Was this helpful?
To get started, you will need to install MinChat React SDK in your React project.
The MinChat SDK needs to be initialized with the MINCHAT_API_KEY
as a parameter as well as a object representing the current user logged in. The API Key can be found on the
The SDK is initialized using the MinChatProvider.
Import the MinChatProvider
at the top of your file.
Wrap your app with the MinChatProvider
passing in the currentUser
and the MINCHAT_API_KEY
as props. The API Key can be found on the .
You can view more details about the currentUser parameters .
Import the useMinChat
hook at the top of your file.
You can now access the MinChat SDK object.
You should create users in your MinChat application to initiate conversations with. Users are at the core of all conversations. MinChat applications are made up of users who chat in either group chats or one-to-one conversations.
note: createUser(...)
automatically creates a new user in the system, if a user with the same username already exists then it will reuse that user.
You can fetch an already existing user using either their username or their id.
You can update an existing user's information
Delete a user by username
Or delete a user by user id
username
string
required
The username of the user to start a conversation with. (note: this user must already be created)
metadata
json object
optional
an optional key value pair for any additional chat information. Accepts string, number and boolean values
name
string
optional
The name of the group chat.
memberUsernames
string
required
username list of participants of the group chat.
avatar
string | file
optional
the avatar of the group chat
metadata
json object
optional
an optional key value pair for any additional chat information. Accepts string, number and boolean values
in MinChat, a is a person that uses your app. Typically, you will have one MinChat for each user in your own database.
Usually, you would create users based on the data from your database. A is represented by a JSON object.
You can view more details about the user parameters .
You can view more details about the user parameters .