Skip to content

[STR-530] Allow platform to set env#32

Merged
frostbournesb merged 6 commits intodevelopfrom
task/dante/str-530
Apr 4, 2023
Merged

[STR-530] Allow platform to set env#32
frostbournesb merged 6 commits intodevelopfrom
task/dante/str-530

Conversation

@frostbournesb
Copy link
Contributor

Notes:
All the env vars must be present to bundle, copy over .env.example exactly.

apiKey no longer goes into the payload, the iframe does nothing with it so it does not belong in payload, it has been renamed to publicKey since secret keys are in the works, now the user will pass the publicKey to the init function onmount, this puts it more in line with checkout's SDK.

the VITE_ANALYTICS_SUBDOMAIN_URL env var is used now

the services were rearchitected slightly to accommodate

In src/routes/+page.svelte:35

window.StringPay.init({
	env: "LOCAL", // Can be "PROD" | "SANDBOX" | "DEV" | "LOCAL"
	publicKey: apiKey
});

Criteria: All envs (save untestable prod) with their respective api keys work as expected without even needing to rebundle.

ocasta181
ocasta181 previously approved these changes Apr 4, 2023
{ name: 'LOCAL_API_URL', value: process.env.LOCAL_API_URL },
]

for (const env of ENV_TABLE) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@frostbournesb frostbournesb merged commit 096b52e into develop Apr 4, 2023
@frostbournesb frostbournesb deleted the task/dante/str-530 branch April 4, 2023 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants