# Blueink Embedded JS

The `blueink-embed-js` library allows you to easily integrate the Blueink signing experience directly into your website or web application using an `<iframe>`.

## GitHub Repository

The library is open source and available on GitHub: 
[Blueink Embedded JS](https://github.com/blueinkhq/blueink-embed-js) <GithubIcon width={16} height={16} />

## Installation

Install the library using npm or yarn:

```bash
npm install @blueink360/blueink-embed-js
```

## Basic Usage

1.  **Generate an Embedded URL**: Use one of our [Client SDKs](/docs/libraries/) to generate an embedded signing URL for a signer.
2.  **Initialize the Embed**: Use the library to open the signing experience.

```javascript
import { BlueinkEmbed } from '@blueink360/blueink-embed-js';

// The URL generated via the API
const signingUrl = "https://secure.blueink.com/signing/xyz123";

const embed = new BlueinkEmbed(signingUrl);

// Optional: Listen for events
embed.on('complete', () => {
    console.log('Signing completed!');
});

embed.on('error', (err) => {
    console.error('An error occurred:', err);
});

// Show the signing experience
embed.show();
```

## Events

The library emits several events that you can listen to:

- `ready`: The signing experience has loaded and is ready for interaction.
- `complete`: The signer has successfully finished signing all documents.
- `cancel`: The signer cancelled the session.
- `error`: An error occurred during the signing session.

## Detailed Guide

For a complete walkthrough on implementing embedded signing, see our [Embedded Signing Guide](/docs/guides/embedded-signing).
