# Create Users

**URL:** https://community.sendbird.com/t/create-users/790
**Category:** Miscellaneous
**Created:** [August 11, 2020, 6:06am UTC](https://community.sendbird.com/t/create-users/790 "2020-08-11T06:06:46Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![vcs\_account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/vcs_account/32/408_2.png) [@vcs\_account](https://community.sendbird.com/u/vcs_account)
#### Post date: [August 11, 2020, 6:06am UTC](https://community.sendbird.com/t/create-users/790/1 "2020-08-11T06:06:46Z")

</div>

Hi SendBird Team,  
I am trying to create Users with **meta data** in UiKit. How can i create user with **meta data** in React.js UiKit?

---

<div class="post-metadata">

### Author: ![Sravan\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sravan_s/32/83_2.png) [@Sravan\_S](https://community.sendbird.com/u/Sravan_S)
#### Post date: [August 11, 2020, 7:07am UTC](https://community.sendbird.com/t/create-users/790/2 "2020-08-11T07:07:43Z")

</div>

Hi @vcs_account

When you declare:

```auto
 <SendbirdProvider
      appId={appId}
      userId={userId}
      nickname={nickname}
      profileUrl={profileUrl}
>
  ....
</>

```

A user will be created(if the user is not present in the server).

To add extra meta data, you should get the SDK instance refer: ([https://codesandbox.io/s/2-5-customizing-chatinput-wgi9d?file=/src/CustomizedMessageInput.js:3709-3756](https://codesandbox.io/s/2-5-customizing-chatinput-wgi9d?file=/src/CustomizedMessageInput.js:3709-3756))

And then call `user.updateMetaData` or `user.createMetaData` as in the link below

> **[User Channel Metadata | JavaScript Chat SDK Documentation | Sendbird](https://docs.sendbird.com/javascript/user_channel_metadata#3_user_metadata)**
>
> With metadata and metacounter which consist of key-value items, you can store additional information to users and channels. This page explains how to manage user metadata, channel metadata, and channel metacounter.

---

<div class="post-metadata">

### Author: ![vcs\_account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/vcs_account/32/408_2.png) [@vcs\_account](https://community.sendbird.com/u/vcs_account)
#### Post date: [August 11, 2020, 9:47am UTC](https://community.sendbird.com/t/create-users/790/3 "2020-08-11T09:47:43Z")

</div>

Thanks @Sravan_S,  
Actually I have my **Users** List which are saved in my database. I want to add these **Users** List into **sendbird** server in one go.  
when i initialize **sendbird app** then i send the list of **Users** and creates all friends on sendbird server.  
how can i create this list in one go?

---

<div class="post-metadata">

### Author: ![Sravan\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sravan_s/32/83_2.png) [@Sravan\_S](https://community.sendbird.com/u/Sravan_S)
#### Post date: [August 11, 2020, 3:45pm UTC](https://community.sendbird.com/t/create-users/790/4 "2020-08-11T15:45:22Z")

</div>

Ah, for this, most probably you need server support. Let me get you in touch with someone who can help

---

<div class="post-metadata">

### Author: ![Alex\_Preston](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/alex_preston/32/167_2.png) [@Alex\_Preston](https://community.sendbird.com/u/Alex_Preston)
#### Post date: [August 11, 2020, 4:44pm UTC](https://community.sendbird.com/t/create-users/790/5 "2020-08-11T16:44:58Z")

</div>

Hey @vcs_account,

I would also recommend using the Platform API call to [create users](https://docs.sendbird.com/platform/user#3_create_a_user) from a security perspective. As you can only issue access/session tokens via the Platform API.

---

<div class="post-metadata">

### Author: ![vcs\_account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/vcs_account/32/408_2.png) [@vcs\_account](https://community.sendbird.com/u/vcs_account)
#### Post date: [August 12, 2020, 5:35am UTC](https://community.sendbird.com/t/create-users/790/6 "2020-08-12T05:35:59Z")

</div>

Thanks @Alex_Preston,  
This link is very helpful for me. 🙂

---

<div class="post-metadata">

### Author: ![vcs\_account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/vcs_account/32/408_2.png) [@vcs\_account](https://community.sendbird.com/u/vcs_account)
#### Post date: [August 12, 2020, 5:43am UTC](https://community.sendbird.com/t/create-users/790/7 "2020-08-12T05:43:25Z")

</div>

Thanks, @Sravan_S for guidance and help. 🙂

---

<div class="post-metadata">

### Author: ![vcs\_account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/vcs_account/32/408_2.png) [@vcs\_account](https://community.sendbird.com/u/vcs_account)
#### Post date: [August 12, 2020, 6:41am UTC](https://community.sendbird.com/t/create-users/790/8 "2020-08-12T06:41:52Z")

</div>

@Sravan_S  
I want to get specific users list in UIKit . Let’s Suppose I have 4 users **A , B , C , D**  
If User **A** is logIn then he shows only **C , D** Users in Users list and when User **B**  
is login then only **A , D** Users Show in Users List.  
Do you have any code sample regarding to this situation.

---

<div class="post-metadata">

### Author: ![Sravan\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sravan_s/32/83_2.png) [@Sravan\_S](https://community.sendbird.com/u/Sravan_S)
#### Post date: [August 12, 2020, 7:53am UTC](https://community.sendbird.com/t/create-users/790/9 "2020-08-12T07:53:14Z")

</div>

So the recommended option here would be to customizing applicationUserListQuery

> **[(3-2) Customizing ChannelListQuery - CodeSandbox](https://codesandbox.io/s/3-2-customizing-channellistquery-z2y89?file=%2Fsrc%2FCustomizedApp.js:1135-1179)**
>
> (3-2) Customizing ChannelListQuery by HoonBaek using @material-ui/core, @material-ui/icons, @material-ui/lab, @material-ui/styles, moment, prop-types, react, react-dom, react-scripts

Maybe add metaDataKeyFilter / metaDataValuesFilter for users and use it to filter userlist?

[https://sendbird.github.io/core-sdk-javascript/module-model\_query\_applicationUserListQuery-ApplicationUserListQuery.html](https://sendbird.github.io/core-sdk-javascript/module-model_query_applicationUserListQuery-ApplicationUserListQuery.html)

If you cannot support your use case this way, there is another option(sadly we do not have example for it for now) I can get back to you  
I will give you this

---

<div class="post-metadata">

### Author: ![vcs\_account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/vcs_account/32/408_2.png) [@vcs\_account](https://community.sendbird.com/u/vcs_account)
#### Post date: [August 13, 2020, 5:20am UTC](https://community.sendbird.com/t/create-users/790/10 "2020-08-13T05:20:38Z")

</div>

Thanks @Sravan_S,  
This is very helpful for me and Thanks for Technical support.  
🙂

---

<div class="post-metadata">

### Author: ![vcs\_account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/vcs_account/32/408_2.png) [@vcs\_account](https://community.sendbird.com/u/vcs_account)
#### Post date: [August 13, 2020, 12:32pm UTC](https://community.sendbird.com/t/create-users/790/11 "2020-08-13T12:32:11Z")

</div>

@Sravan_S,  
Can i use this piece of code for **UiKit**. If i can use then tell me about that how can i use?

```auto
var userIds = ['John', 'Harry'];

groupChannel.inviteWithUserIds(userIds, function(response, error) {
    if (error) {
        return;
    }
});

```

---

<div class="post-metadata">

### Author: ![vcs\_account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/vcs_account/32/408_2.png) [@vcs\_account](https://community.sendbird.com/u/vcs_account)
#### Post date: [August 13, 2020, 12:48pm UTC](https://community.sendbird.com/t/create-users/790/12 "2020-08-13T12:48:37Z")

</div>

@Sravan_S,  
I use this code in UIKit but data is not filtering on User metadata please guide me.

queries={{  
channelListQuery: {  
includeEmpty: true,  
order: ‘latest\_last\_message’,  
customTypesFilter: [props.areaId]  
},  
applicationUserListQuery: {  
limit: 3,  
isLoading: false,  
metaDataKeyFilter : ‘areaGuid’,

```
          }
       }}
```

---

<div class="post-metadata">

### Author: ![Sravan\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sravan_s/32/83_2.png) [@Sravan\_S](https://community.sendbird.com/u/Sravan_S)
#### Post date: [August 14, 2020, 5:55am UTC](https://community.sendbird.com/t/create-users/790/13 "2020-08-14T05:55:08Z")

</div>

> [@vcs\_account](#):
>
> ```auto
> var userIds = ['John', 'Harry'];
> 
> groupChannel.inviteWithUserIds(userIds, function(response, error) {
> if (error) {
> return;
> }
> });
> 
> ```

Internally we use this method internally, actually, you can call it from a component that is wrapped with `withSendBird` same as in the input example. You can acccess SDK, and you should have current channel Id in the upperscope.

You can get channel and then call groupChannel.inviteWithUserIds

> **[(2-5) Customizing MessageInput - CodeSandbox](https://codesandbox.io/s/2-5-customizing-chatinput-wgi9d?file=%2Fsrc%2FCustomizedMessageInput.js)**
>
> (2-5) Customizing MessageInput by HoonBaek using @material-ui/core, @material-ui/icons, @material-ui/lab, @material-ui/styles, prop-types, react, react-dom, react-scripts, sendbird-uikit

example

```auto

const CustomizedComponent = (props) => {
  const {
    sdk,
    // from parent component
    channelUrl,
    usersToAdd, // ['u1', 'u2']
  } = props

  sdk.GroupChannel.getChannel(channelUrl, (channel) => {
    channel.inviteWithUserIds(usersToAdd, (response, error) => {
      if (error) {
        return;
      }
    });
  })
}

const mapStoreToProps = store => {
  const sdk = sendBirdSelectors.getSdk(store);
  return {
    sdk,
  };
};

export default withSendBird(CustomizedComponent, mapStoreToProps);

```

Note that all components should be inside `<SendBirdProvider /`\> tree

---

<div class="post-metadata">

### Author: ![Sravan\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sravan_s/32/83_2.png) [@Sravan\_S](https://community.sendbird.com/u/Sravan_S)
#### Post date: [August 14, 2020, 6:09am UTC](https://community.sendbird.com/t/create-users/790/14 "2020-08-14T06:09:12Z")

</div>

@vcs_account about the

`I use this code in UIKit but data is not filtering on User metadata please guide me.`

Please do not override `isLoading` and `next` 🙂

You have to use metaDataKeyFilter and metaDataValuesFilter together -\>  
See the example here

> **[Application | JavaScript Chat SDK Documentation | Sendbird](https://docs.sendbird.com/javascript/application#3_retrieve_a_list_of_users)**
>
> Before you start building your chat, it is important to understand that your Sendbird application has core functionalities to maintain chat service stability and basic features for application management. This page presents how you can use a Sendbird...

Fox example, in your case, it can be

```auto
applicationUserListQuery: {
  limit: 30,
  metaDataKeyFilter: 'areaGuid',
  metaDataValuesFilter: ['seattle-12', 'seoul-45', 'tokyo-1']
},

```

---

<div class="post-metadata">

### Author: ![vcs\_account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/vcs_account/32/408_2.png) [@vcs\_account](https://community.sendbird.com/u/vcs_account)
#### Post date: [August 17, 2020, 8:00am UTC](https://community.sendbird.com/t/create-users/790/15 "2020-08-17T08:00:33Z")

</div>

@Sravan_S Thanks,  
Awesome stuff for me. Thanks for technical support.  
🙂

---

<div class="post-metadata">

### Author: ![vcs\_account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/vcs_account/32/408_2.png) [@vcs\_account](https://community.sendbird.com/u/vcs_account)
#### Post date: [August 18, 2020, 10:29am UTC](https://community.sendbird.com/t/create-users/790/17 "2020-08-18T10:29:11Z")

</div>

@Sravan_S,  
I am getting Users List from sendbird server but i am getting only 100 users but i want to get more than 100. Scrollbar effect is not working in my Code. Can you guide me what is happening there?

```
 queries={{
                        channelListQuery: {
                            includeEmpty: true,
                            order: 'latest_last_message',
                            customTypesFilter: [props.areaId]
                        }
                        ,
                        applicationUserListQuery: {
                            isLoading: false,
                            hasNext:true,
                            limit:100,
                            metaDataKeyFilter: props.areaName,
                            metaDataValuesFilter: [props.areaId],
                            
                        }

                    }}
```
