Skip to content

Commit 63526fb

Browse files
committed
Update README
1 parent 1c8cea0 commit 63526fb

File tree

1 file changed

+11
-8
lines changed
  • packages/js/examples/flask-mute-test

1 file changed

+11
-8
lines changed

packages/js/examples/flask-mute-test/README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,20 +155,23 @@ Visit `http://localhost:3000/health` to verify:
155155

156156
### JWT Token Generation
157157

158-
The Flask app generates JWT tokens according to the [SignalWire Browser SDK v2 documentation](https://developer.signalwire.com/sdks/browser-sdk/v2/):
158+
The Flask app generates JWT tokens using the SignalWire REST API endpoint:
159159

160160
```python
161+
# Request to SignalWire REST API
162+
url = f"https://{SIGNALWIRE_SPACE}/api/relay/rest/jwt"
161163
payload = {
162-
"iss": SIGNALWIRE_PROJECT_ID, # Issuer (your project)
163-
"sub": f"user-{uuid.uuid4()}", # Subject (unique user)
164-
"iat": int(now.timestamp()), # Issued at
165-
"exp": int((now + timedelta(hours=1)).timestamp()), # Expires in 1 hour
166-
"jti": str(uuid.uuid4()), # JWT ID (unique token)
167-
"resource": "browser", # Resource type
168-
"scopes": ["webrtc"] # Required scopes
164+
"resource": f"browser-{uuid.uuid4()}", # Unique resource identifier
165+
"expires_in": 60 # Token expires in 60 minutes
169166
}
167+
168+
# Authentication using project ID and token
169+
auth = (SIGNALWIRE_PROJECT_ID, SIGNALWIRE_TOKEN)
170+
response = requests.post(url, json=payload, auth=auth)
170171
```
171172

173+
This approach uses SignalWire's official JWT generation endpoint rather than manually creating JWT tokens.
174+
172175
### The Fix Implementation
173176

174177
The fix is in `packages/common/src/webrtc/BaseCall.ts`:

0 commit comments

Comments
 (0)