0.0.6 • Published 2 months ago

@prismicio/service-token v0.0.6

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 months 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

2 months ago

0.0.5

2 months ago

0.0.4

2 months ago

0.0.3

2 months ago

0.0.2

3 months ago

0.0.1

3 months ago