Skip to content

Latest commit

 

History

History
29 lines (17 loc) · 878 Bytes

ssr-only-secrets.cloakssronlysecret.md

File metadata and controls

29 lines (17 loc) · 878 Bytes

Home > ssr-only-secrets > cloakSSROnlySecret

cloakSSROnlySecret() function

Encrypts a secret so that it can be passed from Server Components into the SSR-run of Client Components without them being accessible in the browser.

Use useSSROnlySecret or readSSROnlySecret to decrypt the secret in your Client Component.

Only available in Server Components.

Signature:

export declare function cloakSSROnlySecret(secret: string, encryptionEnvVarName: string): Promise<string>;

Parameters

Parameter Type Description
secret string
encryptionEnvVarName string

Returns:

Promise<string>