Skip to content

Commit 83bb60b

Browse files
authored
Export authorization typings (#249)
1 parent f4274c0 commit 83bb60b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

example/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ import axios from 'axios';
33
import {
44
initialize,
55
getInAppMessages,
6-
updateUserEmail
6+
updateUserEmail,
7+
GenerateJWTPayload
78
} from '@iterable/web-sdk';
89

910
((): void => {
1011
/* set token in the SDK */
1112
const { setEmail, logout } = initialize(
1213
process.env.API_KEY || '',
13-
({ email }) => {
14+
({ email }: GenerateJWTPayload) => {
1415
return axios
1516
.post(
1617
'http://localhost:5000/generate',

src/authorization/authorization.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ import { config } from '../utils/config';
2020

2121
const MAX_TIMEOUT = ONE_DAY;
2222

23-
interface GenerateJWTPayload {
23+
export interface GenerateJWTPayload {
2424
email?: string;
2525
userID?: string;
2626
}
2727

28-
interface WithJWT {
28+
export interface WithJWT {
2929
clearRefresh: () => void;
3030
setEmail: (email: string) => Promise<string>;
3131
setUserID: (userId: string) => Promise<string>;
3232
logout: () => void;
3333
refreshJwtToken: (authTypes: string) => Promise<string>;
3434
}
3535

36-
interface WithoutJWT {
36+
export interface WithoutJWT {
3737
setNewAuthToken: (newToken?: string) => void;
3838
clearAuthToken: () => void;
3939
setEmail: (email: string) => void;

0 commit comments

Comments
 (0)