Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export const createPlaid = (options: PlaidLinkOptions) => {
throw new Error('Plaid not loaded');
}

// Pass jss nonce if it's set
const nonceNode = document.querySelector('meta[property="csp-nonce"]')
options.nonce = nonceNode ? nonceNode.getAttribute('content') : null

const config = renameKeyInObject(
options,
'publicKey',
Expand Down
2 changes: 2 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ interface CommonPlaidLinkOptions {
onLoad?: Function;
// A callback that is called during a user's flow in Link.
onEvent?: Function;
// jss nonce setting from the page if the user has set it.
nonce?: string | null
}

export type PlaidLinkOptionsWithPublicKey = (CommonPlaidLinkOptions & {
Expand Down