> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openpage.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect

> Create and manage experiences, then test connect JWT tokens for seamless integration with your applications.

## Overview

The OpenPage Launcher allows you to create and manage experiences that can be launched directly on the OpenPage platform. When users access your experience through the launcher, they receive a JWT token that enables seamless authentication and reward distribution.

## Key Features

* **Experience Management**: Create and configure experiences for your applications
* **JWT Authentication**: Automatic token-based authentication for launched experiences
* **Reward Integration**: Distribute badges and rewards directly from your launched experience
* **Testing Tools**: Built-in tools to test and validate JWT tokens

## Getting Started

<CardGroup cols={2}>
  <Card title="Create an Experience" icon="plus-circle" href="/connect/overview">
    Learn how to create and configure experiences in the OpenPage Portal.
  </Card>

  <Card title="External Experiences" icon="external-link" href="/connect/external-experiences">
    Set up external experiences that can be launched from OpenPage.
  </Card>

  <Card title="JWT Testing" icon="code" href="#jwt-testing">
    Test and validate JWT tokens for your experiences.
  </Card>
</CardGroup>

## JWT Testing

Once you've created an experience, you can test the JWT token functionality to ensure your integration works correctly.

### 1. Launch Your Experience

1. Navigate to your experience in the OpenPage Portal
2. Click **Launch Experience** to generate a test URL
3. The URL will contain a JWT token parameter: `https://yourexperience.com?token=eyJhbGciOiJIUzI1...`

### 2. Extract and Test the JWT

You can extract the JWT token from the URL and test it using various methods:

#### Using cURL

```bash theme={null}
# Test badge distribution
curl --location 'https://api.openpage.fun/v1/launcher/:id/attribute-badge' \
--header 'X-Api-Key: your-experience-secret' \
--data '{
    "jwt": "eyJhbGciOiJIUzI1...",
    "badgeId": "0000-0000000-00000-00000-00000"
}'
```

#### Using JavaScript

```javascript theme={null}
// Extract JWT from URL
const urlParams = new URLSearchParams(window.location.search);
const jwt = urlParams.get('token');

// Use JWT for API calls
fetch('https://api.openpage.fun/v1/launcher/:id/attribute-badge', {
    method: 'POST',
    headers: {
        'X-Api-Key': 'your-experience-secret',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        jwt: jwt,
        badgeId: '0000-0000000-00000-00000-00000'
    })
});
```

### 3. Validate Token Structure

The JWT token contains important information about the user and experience:

```json theme={null}
{
  "sub": "user-id",
  "exp": 1234567890,
  "iat": 1234567890,
  "experience_id": "experience-id",
  "avatar_id": "avatar-id"
}
```

<Warning>
  Make sure to validate the JWT token on your server side before processing any requests. The token should be verified using the secret key provided in the OpenPage Portal.
</Warning>

## Next Steps

* [Create your first experience](/connect/overview)
* [Set up external experience integration](/launcher/external-experiences)
* [Learn about authentication methods](/api-reference/api-authentication)
* [Explore the full API reference](/api-reference/api-overview)
