SDK Configuration
The Parallel SDK must be initialized with, at minimum, a client_id before any other functions are called.
- React Module
- ES Module
- Manual Loading
import { loadParallel } from '@parallelmarkets/vanilla'
const parallel = loadParallel({ client_id: '123', environment: 'demo', flow_type: 'overlay' })
import { loadParallel } from '@parallelmarkets/vanilla'
// wait for the loading to finish before calling any functions
const parallel = await loadParallel({ client_id: '123', environment: 'demo', flow_type: 'overlay' })
parallel.getLoginStatus(console.log)
<script src="https://app.parallelmarkets.com/sdk/v2/parallel.js"></script>
<script>
Parallel.init({ client_id: '123', environment: 'demo', flow_type: 'overlay' })
</script>
There are a number of optional fields in addition to the required client_id that you can provide:
| Field | Description |
|---|---|
client_id | Required. Displayed when you create a new client in your business settings |
embed_into_id | Optional. Specifies the id of the HTML element on your page where an iframe for the Parallel flow will be inserted. If the flow_type is embed, this field is required. |
environment | Optional. Either production (default) or demo (for sandbox testing) |
flow_type | Optional. Controls where the user completes the Parallel Markets authentication flow. This can be set to one of:
|
force_accreditation_check | Optional. If the entity is not known to be accredited (for instance, a new account or an expired accreditation), then force users through an accreditation flow after they authenticate. Default is true. Ignored if scopes doesn't include accreditation_status. See more details on the Possible Flows page. |
force_identity_check | Optional. If the entity has not completed a KYC/AML identity process recently then force the user through an identity submission/review flow after they authenticate. Default is true. Ignored if scope doesn't include identity. See more details on the Possible Flows page. |
scopes | Optional. An array of scopes that identify the resources to which your application would like to request access. These values inform the consent screen that Parallel Markets displays to the user and the flows the user goes through. Valid scopes are listed in the Scopes section. Includes profile and accreditation_status by default. |
show_dismiss_button | Optional. If show_dismiss_button is true and flow_type is overlay, the interstitial overlay will include a close button in the upper right corner of the overlay. This allows users to close the overlay and return to the original page display without completing a flow. Note: we always hide this button in a mobile context given the limited screen size. Default is false. |
identity_claim_override_id | Optional. An integer ID value used to configure custom thresholds for the identity flow. This would be provided by Parallel based on your custom requirements (if any). |
verbose | Optional. Show debug logging messages in the console (at the "Verbose" logging level). Default is false. |
Scopes
The scopes parameter in the login() call should be an array of scopes that identify the type of information you'd like Parallel to collect and the user to then share. These values inform the consent screen that Parallel Markets displays to the user, and determine what information will be copied into your storage based on user consent.
Here is a list of all available scopes:
| Scope | Description |
|---|---|
profile | This scope provides access to basic information about an individual or business. This scope should always be included since it is necessary to retrieve the basic details of the entity that has authenticated. |
accreditation_status | This provides access to the full accreditation history for an individual or business. |
identity | This scope provides access to detailed KYC/AML data, contact information, identity documents, and any Taxpayer Identification Certification provided (i.e., tax forms like a W-9). |
Ensure your customer account has been enabled for the accreditation_status or identity scopes before attempting to request them. If your account has not been authorized to request those scopes, an error will be shown to the user.