diff --git a/pages/lazer/_meta.json b/pages/lazer/_meta.json index d913535e..15bf7d81 100644 --- a/pages/lazer/_meta.json +++ b/pages/lazer/_meta.json @@ -16,6 +16,7 @@ "type": "separator" }, + "acquire-access-token": "Acquire an Access Token", "subscribe-price-updates": "Subscribe to Price Updates", "integrate-as-consumer": "Integrate as a Consumer", "integrate-as-publisher": "Integrate as a Publisher", diff --git a/pages/lazer/acquire-access-token.mdx b/pages/lazer/acquire-access-token.mdx new file mode 100644 index 00000000..5e3e9334 --- /dev/null +++ b/pages/lazer/acquire-access-token.mdx @@ -0,0 +1,33 @@ +import { Callout } from "nextra/components"; + +# Acquire an Access Token + +This guide explains how to acquire an access token for Pyth Lazer, which is required to authenticate websocket connections and subscribe to price updates. + +## Request Access Token + +Please fill out [this form](https://tally.so/r/nP2lG5) to contact the Pyth team and get the access token. + + + Access tokens are required for all Pyth Lazer websocket connections. Make sure + to keep your token secure and do not share it publicly. + + +## Using the Access Token + +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}`. + +### Example Usage + +```js copy +import { PythLazerClient } from "@pythnetwork/pyth-lazer-sdk"; + +const client = await PythLazerClient.create( + ["wss://pyth-lazer.dourolabs.app/v1/stream"], + "YOUR_ACCESS_TOKEN" +); +``` + +## Next Steps + +After acquiring your access token, you can proceed to [subscribe to price updates](./subscribe-price-updates.mdx) using the Pyth Lazer websocket API.