File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # @codize/sdk
2+
3+ [ ![ NPM Version] ( https://img.shields.io/npm/v/@codize/sdk )] ( https://www.npmjs.com/package/@codize/sdk )
4+ [ ![ GitHub License] ( https://img.shields.io/github/license/codize-dev/sdk )] ( ./LICENSE )
5+
6+ Official TypeScript SDK for the Codize API.
7+
8+ ## Installation
9+
10+ ``` console
11+ $ npm install @codize/sdk
12+ ```
13+
14+ ## Usage
15+
16+ ``` typescript
17+ import { CodizeClient } from " @codize/sdk" ;
18+
19+ // Get your API key from the Codize: https://codize.dev/settings/api-keys
20+ const apiKey = " cdz_****" ;
21+
22+ const client = new CodizeClient ({ apiKey });
23+
24+ const result = await client .sandbox .execute ({
25+ language: " typescript" ,
26+ files: [
27+ {
28+ name: " index.ts" ,
29+ content: ` console.log("Hello, World!"); ` ,
30+ },
31+ ],
32+ });
33+
34+ console .log (result .data );
35+ // => {
36+ // compile: {
37+ // stdout: "",
38+ // stderr: "",
39+ // output: "",
40+ // exit_code: 0,
41+ // },
42+ // run: {
43+ // stdout: "Hello, World!\n",
44+ // stderr: "",
45+ // output: "Hello, World!\n",
46+ // exit_code: 0,
47+ // },
48+ // }
49+ ```
50+
51+ ## License
52+
53+ [ MIT] ( ../LICENSE )
You can’t perform that action at this time.
0 commit comments