Skip to content

Commit

Permalink
Add example of fetching user
Browse files Browse the repository at this point in the history
  • Loading branch information
ericanderson committed May 3, 2024
1 parent 02e6c05 commit 9721a84
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples-extra/basic/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
},
"devDependencies": {
"@osdk/cli": "workspace:^",
"@osdk/foundry": "workspace:^",
"@types/node": "^18.0.0",
"ts-expect": "^1.3.0"
},
Expand Down
6 changes: 6 additions & 0 deletions examples-extra/basic/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
Venture,
WeatherStation,
} from "@osdk/examples.basic.sdk";
import * as Foundry from "@osdk/foundry";
import * as LanguageModel from "@osdk/internal.foundry/Models_LanguageModel";
import { pino } from "pino";
import invariant from "tiny-invariant";
Expand Down Expand Up @@ -56,6 +57,11 @@ const testSubscriptions = true;

async function runTests() {
try {
const myUser = await Foundry.Security.User.meUsers(client.ctx as any, {
preview: true,
});
console.log("User", myUser!.email);

if (runOld) {
await fetchEmployeePage(client);
await fetchEmployeePageByAdUsername(client, "fish");
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9721a84

Please sign in to comment.