-
Notifications
You must be signed in to change notification settings - Fork 13
08. sdjwt Instance & config
Lukas.J.Han edited this page Dec 15, 2023
·
1 revision
You can create a new instance of sdjwt with a custom config.
const sdjwtInstance: sdjwt.create({
hasher: CustomHasher
});
Method of instance is same with default Instance.
sdjwt.config({
hasher: CustomHasher
});
- The config type
type SDJWTConfig = {
omitTyp?: boolean; // omit typ property in JWT header
hasher?: Hasher; // custom hash function: (data: string) => Promise<string>;
saltGenerator?: SaltGenerator; // custom salt generate function: (length: number) => string;
};