Skip to content

Commit f0988b9

Browse files
devin-ai-integration[bot]Jayant
andauthored
Add 'Acquire an Access Token' page to Lazer how-to guides (#842)
* Add 'Acquire an Access Token' page to Lazer how-to guides - Create new standalone guide for acquiring Pyth Lazer access tokens - Extract content from Subscribe to Price Updates guide - Add navigation entry in _meta.json under How-To Guides section - Update Subscribe to Price Updates to reference new standalone guide - Include form link, security callout, usage instructions, and code example Co-Authored-By: Jayant <[email protected]> * Remove cross-reference link from Subscribe to Price Updates - Address PR feedback from jayantk to undo the cross-reference change - Keep the original text: '1. **Acquire** an access token.' Co-Authored-By: Jayant <[email protected]> * Fix prettier formatting in acquire-access-token.mdx - Apply prettier formatting to Callout component text - Break long line into multiple lines with proper indentation - Resolves pre-commit CI failure Co-Authored-By: Jayant <[email protected]> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Jayant <[email protected]>
1 parent 8b5f736 commit f0988b9

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

pages/lazer/_meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"type": "separator"
1717
},
1818

19+
"acquire-access-token": "Acquire an Access Token",
1920
"subscribe-price-updates": "Subscribe to Price Updates",
2021
"integrate-as-consumer": "Integrate as a Consumer",
2122
"integrate-as-publisher": "Integrate as a Publisher",
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Callout } from "nextra/components";
2+
3+
# Acquire an Access Token
4+
5+
This guide explains how to acquire an access token for Pyth Lazer, which is required to authenticate websocket connections and subscribe to price updates.
6+
7+
## Request Access Token
8+
9+
Please fill out [this form](https://tally.so/r/nP2lG5) to contact the Pyth team and get the access token.
10+
11+
<Callout type="info">
12+
Access tokens are required for all Pyth Lazer websocket connections. Make sure
13+
to keep your token secure and do not share it publicly.
14+
</Callout>
15+
16+
## Using the Access Token
17+
18+
Once you receive your access token, use it to authenticate the websocket connection by passing it as an `Authorization` header with the value `Bearer {token}`.
19+
20+
### Example Usage
21+
22+
```js copy
23+
import { PythLazerClient } from "@pythnetwork/pyth-lazer-sdk";
24+
25+
const client = await PythLazerClient.create(
26+
["wss://pyth-lazer.dourolabs.app/v1/stream"],
27+
"YOUR_ACCESS_TOKEN"
28+
);
29+
```
30+
31+
## Next Steps
32+
33+
After acquiring your access token, you can proceed to [subscribe to price updates](./subscribe-price-updates.mdx) using the Pyth Lazer websocket API.

0 commit comments

Comments
 (0)