Skip to content

Add support for auto-detecting publishable key? #55

@Firehed

Description

@Firehed

While this probably won't be useful for NPM-type apps, some application templating systems will make it easier to dump a value on the page somewhere and handle it through the client. There are a couple of paths that could probably improve setup:

<script>
const SNAPAUTH_PUBLISHABLE_KEY = '(set by backend rendering)'
// ... probably in a different script
const snapAuth = new SnapAuth.SDK()
</script>

and

<script src="https://cdn.snapauth.app/js/1.2.3.js" data-key="pubkey_abc123"></script>

Exact mechanics TBD, but I found some of the setup mechanics a little clumsy when making a demo with Laravel (specifically with getting the right envvars into the JS)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions