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

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

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

Using JavaScript

// Extract JWT from URL
const urlParams = new URLSearchParams(window.location.search);
const jwt = urlParams.get('token');

// Use JWT for API calls
fetch('https://api.op.xyz/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:
{
  "sub": "user-id",
  "exp": 1234567890,
  "iat": 1234567890,
  "experience_id": "experience-id",
  "avatar_id": "avatar-id"
}
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.

Next Steps