Repository
Current version released
5 years ago
Dependencies
std
Versions
forge-deno-sdk
Experimental Autodesk Forge SDK for Deno (v1.7.0).
Prerequisites
Usage
- 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://raw.githubusercontent.com/petrbroz/forge-deno-sdk/{VERSION}/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.tsTest
- 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 testFormat code
deno fmt **/*.ts