Skip to content

Commit

Permalink
ensure exp is always set to 1h
Browse files Browse the repository at this point in the history
  • Loading branch information
sachaarbonel committed Nov 9, 2023
1 parent 9f3d7f9 commit c1a6c32
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ client.upsert_users(
user_id: {'id': user_id}
}
)
token = client.create_token(user_id)

# the token will be valid for 1 hour
exp = int(time.time()) + 60 * 60

token = client.create_token(user_id,expiration=exp)

rtmp_url = response.data().call.ingress.rtmp.address.replace('<your_token_here>', token)
```
Expand Down
6 changes: 5 additions & 1 deletion docusaurus/video/docusaurus/docs/api/streaming/rtmp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ response = call.create(

# user ID of an existing user
userId = 'jane'
token = client.create_token(userId)

# the token will be valid for 1 hour
exp = int(time.time()) + 60 * 60

token = client.create_token(userId, expiration = exp)

# replace <your_token_here> in rtmp address with actual token
address = response.data().call.ingress.rtmp.address.replace('<your_token_here>', token)
Expand Down

0 comments on commit c1a6c32

Please sign in to comment.