Skip to content

Commit

Permalink
add token provider example to node
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Nov 7, 2023
1 parent 48667ca commit 8155d04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ client.create_token(user_id = user_id, expiration = exp)
</TabItem>
</Tabs>

You need to provide the generated tokens to the client SDKs. Stream SDKs accept a token provider, that can be called to retrieve and renew tokens. You need to implement the token provider in your own application, this is usually an HTTP endpoint.

Example [token provider for the Node SDK using Express](https://codesandbox.io/p/sandbox/stream-node-token-provider-example-f9cl27).

## Call tokens

Call tokens contain a list of call IDs. If a user is authenticated with a call token, they can only access the specified calls. They are helpful if you want to limit call access, but you want to avoid managing call members (an example: a pay-pre-view link for livestreams, with hundreds of thousands of expected viewers).
Expand Down
2 changes: 2 additions & 0 deletions docusaurus/video/docusaurus/docs/api/basics/get_started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ You can optionally pass a timeout for the API requests, the default timeout is 3

```js
import { StreamClient } from '@stream-io/node-sdk';
// or
// const { StreamClient } = require("@stream-io/node-sdk");

const apiKey = '';
const secret = '';
Expand Down

0 comments on commit 8155d04

Please sign in to comment.