Files
zitadel/packages/zitadel-server/examples/app.ts
2023-04-20 14:39:51 +02:00

29 lines
557 B
TypeScript

import {
ZitadelServerOptions,
getServer,
getServers,
initializeServer,
} from "#";
import { GetMyUserResponse, getAuth } from "#/auth";
async function getMyUser(): Promise<GetMyUserResponse> {
const auth = await getAuth();
const response = await auth.getMyUser({});
return response;
}
async function main() {
const zitadelConfig: ZitadelServerOptions = {
apiUrl: "https://dev-mfhquc.zitadel.cloud/",
token: "123",
};
if (!getServers().length) {
initializeServer(zitadelConfig);
}
const app = getServer();
}
main();