Skip to content

Home > Documentation > API Reference

API Reference ​

Complete API documentation for ParleyJS.

Overview ​

This section provides detailed documentation for all ParleyJS classes, methods, types, and error codes. Use this as a reference when implementing ParleyJS in your application.

For quick examples and common patterns, see Framework Reference.

Contents ​

Core Documentation ​

Complete API Documentation ​

  • API.md - Comprehensive API documentation with examples

Quick Reference ​

Essential Methods ​

Creating an instance:

javascript
const parley = Parley.create({
    allowedOrigins: ['https://example.com'],
});

Connecting to a window:

javascript
await parley.connect(targetWindow, 'target-id');

Sending messages:

javascript
const response = await parley.send('message-type', payload, {
    targetId: 'target-id',
});

Receiving messages:

javascript
parley.on('message-type', (payload, respond) => {
    respond({ result: 'success' });
});

For more details, see Methods.

Organization ​

The API documentation is organized by:

  • Methods - Grouped by functionality (connection, messaging, events)
  • System Events - Lifecycle and monitoring events
  • Errors - Common errors with solutions

Using This Reference ​

If you want to:

If you're looking for:

TypeScript Support ​

ParleyJS is written in TypeScript and provides complete type definitions. All methods support generic types for request and response payloads.

For details on TypeScript usage, see Installation Guide.


Sections:

Back to: Documentation Home | Project Home

Released under the MIT License.