Files
zitadel/packages/zitadel-server/examples/app.ts

29 lines
557 B
TypeScript
Raw Normal View History

2023-04-20 14:26:55 +02:00
import {
ZitadelServerOptions,
getServer,
getServers,
initializeServer,
2023-04-20 14:39:51 +02:00
} from "#";
2023-04-20 14:26:55 +02:00
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();