
<CH.Code>
```typescript GetTransientToken.ts
import { PlexAPI } from "@lukehagar/plexjs";
import { GetTransientTokenQueryParamType, Scope } from "@lukehagar/plexjs/models/operations";

async function run() {
  const sdk = new PlexAPI({
    accessToken: "<YOUR_API_KEY_HERE>",
    xPlexClientIdentifier: "<value>",
  });

  const type = GetTransientTokenQueryParamType.Delegation;
  const scope = Scope.All;
  
  const result = await sdk.authentication.getTransientToken(type, scope);

  // Handle the result
  console.log(result)
}

run();
```
---

```json Example Response
  {
    "errors": [
      {
        "code": 1001,
        "message": "User could not be authenticated",
        "status": 401
      }
    ],
    "HttpMeta": {}
  }
```
</CH.Code>
