0.0.6 • Published 1 year ago

@prismicio/service-token v0.0.6

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

service-token

Validate Prismic Context.

Example

import { decodeContext } from "@prismicio/service-token";

const token = "user-or-wroom-or-m2m-token-string";

async function main() {
	const res = await fetch(`https://auth.wroom.io/validate?token=${token}`);
	const body = await res.json();

	const decodedContext = decodeContext(body);

	if (decodedContext.isValid) {
		console.log(decodedContext.decoded);
	} else {
		console.error(decodedContext.error);
	}
}

main();
0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago