@@ -31,7 +31,7 @@ use wasm_bindgen::prelude::*;
3131// ```ts
3232// // Step 1: Initialize app
3333// const { PULSEBEAM_API_KEY, PULSEBEAM_API_SECRET } = process.env;
34- // const app = new App (PULSEBEAM_API_KEY, PULSEBEAM_API_SECRET);
34+ // const app = new AccessToken (PULSEBEAM_API_KEY, PULSEBEAM_API_SECRET);
3535//
3636// // Step 2: Listen for JWT requests from your clients'
3737// router.post('/auth', (req, res) => {
@@ -202,7 +202,7 @@ impl PeerPolicy {
202202///
203203/// ```ts
204204/// const { PULSEBEAM_API_KEY, PULSEBEAM_API_SECRET } = process.env;
205- /// const app = new App (PULSEBEAM_API_KEY, PULSEBEAM_API_SECRET);
205+ /// const app = new AccessToken (PULSEBEAM_API_KEY, PULSEBEAM_API_SECRET);
206206///
207207/// router.post('/auth', (req, res) => {
208208/// const claims = new PeerClaims("myGroup1", "myPeer1");
@@ -214,24 +214,24 @@ impl PeerPolicy {
214214/// res.json({ groupId, peerId, token });
215215/// });```
216216#[ wasm_bindgen]
217- pub struct App {
217+ pub struct AccessToken {
218218 #[ wasm_bindgen( skip) ]
219219 pub api_key : String ,
220220 #[ wasm_bindgen( skip) ]
221221 pub api_secret : String ,
222222}
223223
224224#[ wasm_bindgen]
225- impl App {
226- /// Creates a new `App ` instance using your config. Essential for creating
225+ impl AccessToken {
226+ /// Creates a new `AccessToken ` instance using your config. Essential for creating
227227 /// client tokens.
228228 ///
229229 /// Get an api_key and api_secret from {@link https://pulsebeam.dev}
230230 ///
231231 /// # Examples
232232 ///
233233 /// ```ts
234- /// const app = new App (MY_API_KEY, MY_API_SECRET);```
234+ /// const app = new AccessToken (MY_API_KEY, MY_API_SECRET);```
235235 #[ wasm_bindgen( constructor) ]
236236 pub fn new ( api_key : & str , api_secret : & str ) -> Self {
237237 Self {
@@ -301,9 +301,9 @@ mod tests {
301301
302302 #[ test]
303303 fn test_create_token ( ) -> anyhow:: Result < ( ) > {
304- let app = App :: new (
305- "kid_Ycl5ClRWJWNw8bqB25DMH " ,
306- "sk_e63bd11ff7491adc5f7cca5a4566b94d75ea6a9bafcd68252540eaa493a42109 " ,
304+ let app = AccessToken :: new (
305+ "kid_73d8caa6c387d46c " ,
306+ "sk_7edea599046490dfd271b863b03398d2b613812b1f23efd023ca3b08026d3e67 " ,
307307 ) ;
308308
309309 let claims = PeerClaims :: new ( "default" , "alice" ) ;
0 commit comments