Skip to content

Commit a6476ae

Browse files
authored
Merge pull request #26 from phantom/napas/add-sdk-override-param
chore: Add sdk override url
2 parents 546da54 + a916f97 commit a6476ae

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/unlucky-fishes-tease.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@phantom/wallet-sdk": patch
3+
---
4+
5+
Add SDK override URL parameter

packages/sdk/src/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ export type CreatePhantomConfig = Partial<{
1616
paddingTop: number
1717
paddingLeft: number
1818
position: Position
19+
sdkURL: string
1920
}>
2021

2122
export function createPhantom (config: CreatePhantomConfig = {}): void {
2223
const container = document.head ?? document.documentElement
2324
const scriptTag = document.createElement('script')
2425

25-
const sdkURL = new URL(SDK_URL)
26+
const sdkURL = new URL(config.sdkURL ?? SDK_URL)
2627
if ('zIndex' in config && config.zIndex != null) {
2728
sdkURL.searchParams.append('zIndex', config.zIndex.toString())
2829
}
@@ -60,3 +61,4 @@ export function createPhantom (config: CreatePhantomConfig = {}): void {
6061
container.insertBefore(scriptTag, container.children[0])
6162
container.removeChild(scriptTag)
6263
}
64+

0 commit comments

Comments
 (0)