diff --git a/README.md b/README.md index 474e3bcb..0e213e5b 100644 --- a/README.md +++ b/README.md @@ -241,6 +241,16 @@ import { getCtsToken } from '@cipherstash/nextjs' export default async function Page() { const ctsToken = await getCtsToken() + // getCtsToken returns either + // --- + // { success: true, ctsToken: CtsToken } + // or + // { success: false, error: string } + + if (!ctsToken.success) { + // handle error + } + return (

Server side rendered page

@@ -259,6 +269,11 @@ import { getCtsToken } from '@cipherstash/nextjs' export default async function Page() { const ctsToken = await getCtsToken() + + if (!ctsToken.success) { + // handle error + } + const lockContext = new LockContext({ ctsToken })