···10101111## Usage
12121313-### `client-metadata.json`
1313+### Client metadata
14141515Create a [`client-metadata.json`](https://github.com/bluesky-social/atproto/blob/main/packages/api/OAUTH.md#step-1-create-your-client-metadata):
1616···6161When the user is redirected back to your application, they'll be authenticated! You can get the PDS host from the session:
62626363```js
6464-import { listSessions } from "./atsw.js";
6464+import { getSession, listSessions } from "./atsw.js";
65656666-const [session] = await listSessions();
6666+const session = await getSession("did:plc:users-did-goes-here");
6767+const allSessions = await listSessions();
6768```
68696970### Making requests
70717171-You can make authenticated requests using plain `fetch` calls:
7272+Make authenticated requests using plain `fetch` calls:
72737374```js
7475const res = await fetch(`${session.pds}/xrpc/com.atproto.server.getSession`);
···7677```
77787879Any requests to the authenticated user's PDS will automatically include an auth token and handle DPoP retries and token refreshes.
8080+8181+If a user has multiple authenticated sessions with the same PDS, use the `x-atsw-did` header to indicate which user's authentication token to use:
8282+8383+```js
8484+const res = await fetch(`${session.pds}/xrpc/com.atproto.server.getSession`, {
8585+ headers: { "x-atsw-did": session.did }
8686+});
8787+const data = await res.json();
8888+```
79898090### Logging out
8191