This is documentation for Parallel Developer Documentation **Legacy – v1.x**, which is no longer actively maintained.

For up-to-date documentation, see the **[latest version](https://developer.parallelmarkets.com/docs/server)** (Current – v2.x).

Version: Legacy – v1.x

## Embedded Flow Sequence Diagram

The Parallel JavaScript Software Development Kit (SDK) provides the same OAuth2.0 authorization code flow as [the server API](https://developer.parallelmarkets.com/docs/1.x/server), but it takes place entirely in the browser. Parallel JS SDK integrations automatically make use of the [OAuth2.0 PKCE extension](https://oauth.net/2/pkce/), which prevents request forgery and injection attacks.

Calling `loadParallel(...)` or `Parallel.init(...)` with the [appropriate config](https://developer.parallelmarkets.com/docs/1.x/javascript/configuration) will inject a "Parallel Passport" button that, when clicked, will initialize the flow. The following sequence diagram describes the `overlay` and `embed` flow types, whereby the Parallel experience is rendered inside an `<iframe/>` on the Partner Site.

### Sequence Flow:

1. Partner site initializes Parallel JS SDK with appropriate config
2. Parallel SDK builds OAuth2.0 redirect URL with OAuth2.0+PKCE code challenge.
3. User sees "Parallel Passport" button
4. User sees embedded Parallel experience within Partner Site
5. User will be navigated through flow(s) as necessary to fulfill the specified scopes
    - ✔ KYC/Accreditation process complete
6. [Save Tokens for Ongoing Access]

### Request and Response Flow:

- **User Visit**: Partner Site
    - **GET /**: Initialize Parallel SDK
        - Attach "Parallel Passport" button to DOM
            - **Click "Parallel Passport"**
                - **Handle Button Click**
                    - **GET /v1/oauth/authorize?client_id=...**
                        - **302 FOUND**: Attach IFRAME to DOM
                            - **GET /oauth/entry/{uuid}**
                                - **200 OK**: Render embedded Parallel app
                                    - Confirm email & provide info
                                    - Upload information & documentation
                                    - Finish required flow(s)
                                        - Store access/refresh tokens
                                            - **201 CREATED**
