> For the complete documentation index, see [llms.txt](https://beta.docs.solaceprotocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://beta.docs.solaceprotocol.com/integration/react-native-alpha-version/session-key-usage.md).

# 🔑 Session Key Usage

### Request Signing Permission

You can request permissions for function signing with the `requestSigningPermission` method:

```typescript
const data = {
  privateKey: 'YOUR_NEW_PRIVATE_EPHEMERAL_KEY',
  permissions: [ /* permissions array */ ],
  id: 'YOUR_ID'
};
solaceConnect.requestSigningPermission(data).then((signers) => {
  console.log("Received signers: ", signers);
}).catch((err) => {
  console.error("Failed to request signing permission: ", err);
});
```

### Attach Session

You can attach a session to the Solace Connect instance using the `attachSession` method:

```typescript
solaceConnect.attachSession('YOUR_JWT_TOKEN');
```

### Get Session Token

You can retrieve the current session token using the `getSessionToken` method:

```typescript
solaceConnect.getSessionToken().then((sessionToken) => {
  console.log("Session token: " + sessionToken);
}).catch((err) => {
  console.error("Failed to get session token: ", err);
});
```

### Get Solace Signer

You can retrieve a SolaceSigner instance using the `getSolaceSigner` method:

```typescript
const ephemeralSigner = { /* your ephemeral signer object */ };
solaceConnect.getSolaceSigner(ephemeralSigner).then((signer) => {
  console.log("Received SolaceSigner: ", signer);
}).catch((err) => {
  console.error("Failed to get SolaceSigner: ", err);
});
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://beta.docs.solaceprotocol.com/integration/react-native-alpha-version/session-key-usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
