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
- Methods - All ParleyJS methods with parameters and return types
- System Events - System event reference
- Common Errors - Error reference and solutions
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:
- Find a specific method: See Methods
- Understand system events: See System Events
- Debug an error: See Common Errors
- See complete examples: See API.md
If you're looking for:
- How-to guides: See Guides
- Code patterns: See Patterns
- Troubleshooting: See Troubleshooting
Related Sections
- Framework Reference - Quick start guide
- Code Patterns - Common usage patterns
- Examples - Working code examples
- Guides - Use-case specific tutorials
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.
Navigation
Sections:
- Methods - Method reference
- System Events - Event reference
- Common Errors - Error reference
Back to: Documentation Home | Project Home
