You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+36
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,7 @@ use a different version of this client.
62
62
63
63
| Dgraph version | dgraph-js-http version |
64
64
| :------------: | :--------------------: |
65
+
| >= 21.03.0 | >= _21.3.0_|
65
66
| >= 20.03.0 | >= _20.3.0_|
66
67
| >= 1.1 | >= _1.1.0_|
67
68
@@ -97,6 +98,41 @@ const dgraphClient = new dgraph.DgraphClient(clientStub);
97
98
98
99
To facilitate debugging, [debug mode](#debug-mode) can be enabled for a client.
99
100
101
+
### Multi-tenancy
102
+
103
+
In [multi-tenancy](https://dgraph.io/docs/enterprise-features/multitenancy) environments, `dgraph-js-http` provides a new method `loginIntoNamespace()`,
104
+
which will allow the users to login to a specific namespace.
105
+
106
+
In order to create a JavaScript client, and make the client login into namespace `123`:
awaitdgraphClientStub.loginIntoNamespace("groot", "password", 123); // where 123 is the namespaceId
111
+
```
112
+
113
+
In the example above, the client logs into namespace `123` using username `groot` and password `password`.
114
+
Once logged in, the client can perform all the operations allowed to the `groot` user of namespace `123`.
115
+
116
+
### Create a Client for Dgraph Cloud Endpoint
117
+
118
+
If you want to connect to Dgraph running on your [Dgraph Cloud](https://cloud.dgraph.io) instance, then all you need is the URL of your Dgraph Cloud endpoint and the API key. You can get a client using them as follows:
0 commit comments