Experimental Autodesk Forge SDK for Deno (v1.7.0).
Available on https://deno.land:
- Code: https://deno.land/x/forge@v0.1.0/mod.ts
- Docs: https://doc.deno.land/https/deno.land/x/forge/mod.ts
- Import any classes you need from the mod.ts file of a specific version of this module, for example:
// app.ts
import { AuthenticationClient } from "https://deno.land/x/forge@v0.1.0/mod.ts";
const FORGE_CLIENT_ID = Deno.env.get("FORGE_CLIENT_ID");
const FORGE_CLIENT_SECRET = Deno.env.get("FORGE_CLIENT_SECRET");
if (!FORGE_CLIENT_ID || !FORGE_CLIENT_SECRET) {
console.error("Missing environment variables");
Deno.exit(1);
}
async function run() {
const client = new AuthenticationClient(FORGE_CLIENT_ID, FORGE_CLIENT_SECRET);
const token = await client.authenticate(["data:read"], false);
console.log(token);
}
run();
- Set the following environment variables:
FORGE_CLIENT_ID
- your Forge application's client IDFORGE_CLIENT_SECRET
- your Forge application's client secret
- Run your app from the terminal, for example:
deno app.ts
- Set the following environment variables:
FORGE_CLIENT_ID
- your Forge application's client IDFORGE_CLIENT_SECRET
- your Forge application's client secret
- Run the following command in the terminal:
deno test
deno fmt **/*.ts