Skip to content

Commit fa9e294

Browse files
authored
moved quickstart example from JS to TS and Bun (#609)
* moved quickstart example from JS to TS and Bun * implemented nabors' feedback
1 parent 50d9638 commit fa9e294

File tree

1 file changed

+68
-63
lines changed

1 file changed

+68
-63
lines changed

app/en/home/quickstart/page.mdx

Lines changed: 68 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Install and use the Arcade client to call Arcade Hosted Tools.
2222
- An <SignupLink linkLocation="docs:call-tools-directly">Arcade account</SignupLink>
2323
- An [Arcade API key](/home/api-keys)
2424
- The [`uv` package manager](https://docs.astral.sh/uv/getting-started/installation/) if you are using Python
25-
- The [`npm` package manager](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) if you are using JavaScript or TypeScript
25+
- The [`bun` runtime](https://bun.com/) if you are using TypeScript
2626

2727
</GuideOverview.Prerequisites>
2828

@@ -42,7 +42,7 @@ Install and use the Arcade client to call Arcade Hosted Tools.
4242

4343
### Install the Arcade client
4444

45-
<Tabs items={["Python", "JavaScript"]} storageKey="preferredLanguage">
45+
<Tabs items={["Python", "TypeScript"]} storageKey="preferredLanguage">
4646

4747
<Tabs.Tab>
4848
In your terminal, run the following command to install the Python client package `arcadepy`:
@@ -57,7 +57,7 @@ uv pip install arcadepy
5757
In your terminal, run the following command to install the JavaScript client package `@arcadeai/arcadejs`:
5858

5959
```bash
60-
npm install @arcadeai/arcadejs
60+
bun install @arcadeai/arcadejs
6161
```
6262

6363
</Tabs.Tab>
@@ -66,7 +66,7 @@ npm install @arcadeai/arcadejs
6666

6767
### Setup the client
6868

69-
<Tabs items={["Python", "JavaScript"]} storageKey="preferredLanguage">
69+
<Tabs items={["Python", "TypeScript"]} storageKey="preferredLanguage">
7070

7171
<Tabs.Tab>
7272

@@ -87,9 +87,9 @@ user_id = "{arcade_user_id}"
8787

8888
<Tabs.Tab>
8989

90-
Create a new script called `example.mjs`:
90+
Create a new script called `example.ts`:
9191

92-
```javascript filename="example.ts"
92+
```typescript filename="example.ts"
9393
import Arcade from "@arcadeai/arcadejs";
9494

9595
// You can also set the `ARCADE_API_KEY` environment variable instead of passing it as a parameter.
@@ -137,16 +137,16 @@ def authorize_and_run_tool(tool_name, input, user_id):
137137

138138
<Tabs.Tab>
139139

140-
```javascript filename="example.ts"
140+
```typescript filename="example.ts"
141141
// Helper function to authorize and run any tool
142142
async function authorize_and_run_tool({
143143
tool_name,
144144
input,
145145
user_id,
146146
}: {
147-
tool_name: string,
148-
input: any,
149-
user_id: string,
147+
tool_name: string;
148+
input: any;
149+
user_id: string;
150150
}) {
151151
// Start the authorization process
152152
const authResponse = await client.tools.authorize({
@@ -184,7 +184,7 @@ In this example workflow, we:
184184
- Create a Google Doc with the news
185185
- Send a link to the Google Doc to the user
186186

187-
<Tabs items={["Python", "JavaScript"]} storageKey="preferredLanguage">
187+
<Tabs items={["Python", "TypeScript"]} storageKey="preferredLanguage">
188188

189189
<Tabs.Tab>
190190

@@ -243,7 +243,7 @@ print(response_send_email.output.value)
243243

244244
<Tabs.Tab>
245245

246-
```javascript filename="example.mjs"
246+
```typescript filename="example.ts"
247247
// This tool does not require authorization, so it will return the results
248248
// without prompting the user to authorize the app.
249249
const response_search = await authorize_and_run_tool({
@@ -302,66 +302,71 @@ console.log(respose_send_email.output?.value);
302302

303303
### Run the code
304304

305-
<Tabs items={["Python", "JavaScript"]} storageKey="preferredLanguage">
305+
<Tabs items={["Python", "TypeScript"]} storageKey="preferredLanguage">
306306

307307
<Tabs.Tab>
308308

309309
```bash
310310
uv run example.py
311-
> latest news about MCP URL mode elicitation:
312-
> ----------------------------
313-
> InfoWorld - Visual Studio Code adds multi-agent orchestration
314-
> https://www.infoworld.com/article/4105879/visual-studio-code-adds-multi-agent-orchestration.html
315-
> ----------------------------
316-
> Visual Studio Magazine - VS Code 1.107 (November 2025 Update) Expands Multi-Agent Orchestration, Model Management
317-
> https://visualstudiomagazine.com/articles/2025/12/12/vs-code-1-107-november-2025-update-expands-multi-agent-orchestration-model-management.aspx
318-
> ----------------------------
319-
> SD Times - Several new updates make their way into the MCP specification
320-
> https://sdtimes.com/ai/several-new-updates-make-their-way-into-the-mcp-specification/
321-
> ----------------------------
322-
> AI News - How the MCP spec update boosts security as infrastructure scales
323-
> https://www.artificialintelligence-news.com/news/how-the-mcp-spec-update-boosts-security-as-infrastructure-scales/
324-
>
325-
> {'body': '', 'cc': '', 'date': '', 'from': '', 'header_message_id': '', 'history_id': '', 'id': '19b....', 'in_reply_to': '', 'label_ids': ['UNREAD', 'SENT', 'INBOX'], 'references': '', 'reply_to': '', 'snippet': '', 'subject': '', 'thread_id': '19b....', 'to': '', 'url': 'https://mail.google.com/mail/u/0/#sent/19b....'}
311+
```
312+
```text
313+
latest news about MCP URL mode elicitation:
314+
----------------------------
315+
InfoWorld - Visual Studio Code adds multi-agent orchestration
316+
https://www.infoworld.com/article/4105879/visual-studio-code-adds-multi-agent-orchestration.html
317+
----------------------------
318+
Visual Studio Magazine - VS Code 1.107 (November 2025 Update) Expands Multi-Agent Orchestration, Model Management
319+
https://visualstudiomagazine.com/articles/2025/12/12/vs-code-1-107-november-2025-update-expands-multi-agent-orchestration-model-management.aspx
320+
----------------------------
321+
SD Times - Several new updates make their way into the MCP specification
322+
https://sdtimes.com/ai/several-new-updates-make-their-way-into-the-mcp-specification/
323+
----------------------------
324+
AI News - How the MCP spec update boosts security as infrastructure scales
325+
https://www.artificialintelligence-news.com/news/how-the-mcp-spec-update-boosts-security-as-infrastructure-scales/
326+
327+
{'body': '', 'cc': '', 'date': '', 'from': '', 'header_message_id': '', 'history_id': '', 'id': '19b....', 'in_reply_to': '', 'label_ids': ['UNREAD', 'SENT', 'INBOX'], 'references': '', 'reply_to': '', 'snippet': '', 'subject': '', 'thread_id': '19b....', 'to': '', 'url': 'https://mail.google.com/mail/u/0/#sent/19b....'}
326328
```
327329

328330
</Tabs.Tab>
329331
<Tabs.Tab>
330332

331333
```bash
332-
node example.ts
333-
> latest news about MCP URL mode elicitation:
334-
> --------------------------------
335-
> InfoWorld - Visual Studio Code adds multi-agent orchestration
336-
> https://www.infoworld.com/article/4105879/visual-studio-code-adds-multi-agent-orchestration.html
337-
> --------------------------------
338-
> Visual Studio Magazine - VS Code 1.107 (November 2025 Update) Expands Multi-Agent Orchestration, Model Management
339-
> https://visualstudiomagazine.com/articles/2025/12/12/vs-code-1-107-november-2025-update-expands-multi-agent-orchestration-model-management.aspx
340-
> --------------------------------
341-
> SD Times - Several new updates make their way into the MCP specification
342-
> https://sdtimes.com/ai/several-new-updates-make-their-way-into-the-mcp-specification/
343-
> --------------------------------
344-
> AI News - How the MCP spec update boosts security as infrastructure scales
345-
> https://www.artificialintelligence-news.com/news/how-the-mcp-spec-update-boosts-security-as-infrastructure-scales/
346-
>
347-
> {
348-
> body: "",
349-
> cc: "",
350-
> date: "",
351-
> from: "",
352-
> header_message_id: "",
353-
> history_id: "",
354-
> id: "19b...",
355-
> in_reply_to: "",
356-
> label_ids: [ "UNREAD", "SENT", "INBOX" ],
357-
> references: "",
358-
> reply_to: "",
359-
> snippet: "",
360-
> subject: "",
361-
> thread_id: "19b...",
362-
> to: "",
363-
> url: "https://mail.google.com/mail/u/0/#sent/19b...",
364-
> }
334+
bun run example.ts
335+
```
336+
337+
```text
338+
latest news about MCP URL mode elicitation:
339+
--------------------------------
340+
InfoWorld - Visual Studio Code adds multi-agent orchestration
341+
https://www.infoworld.com/article/4105879/visual-studio-code-adds-multi-agent-orchestration.html
342+
--------------------------------
343+
Visual Studio Magazine - VS Code 1.107 (November 2025 Update) Expands Multi-Agent Orchestration, Model Management
344+
https://visualstudiomagazine.com/articles/2025/12/12/vs-code-1-107-november-2025-update-expands-multi-agent-orchestration-model-management.aspx
345+
--------------------------------
346+
SD Times - Several new updates make their way into the MCP specification
347+
https://sdtimes.com/ai/several-new-updates-make-their-way-into-the-mcp-specification/
348+
--------------------------------
349+
AI News - How the MCP spec update boosts security as infrastructure scales
350+
https://www.artificialintelligence-news.com/news/how-the-mcp-spec-update-boosts-security-as-infrastructure-scales/
351+
352+
{
353+
body: "",
354+
cc: "",
355+
date: "",
356+
from: "",
357+
header_message_id: "",
358+
history_id: "",
359+
id: "19b...",
360+
in_reply_to: "",
361+
label_ids: [ "UNREAD", "SENT", "INBOX" ],
362+
references: "",
363+
reply_to: "",
364+
snippet: "",
365+
subject: "",
366+
thread_id: "19b...",
367+
to: "",
368+
url: "https://mail.google.com/mail/u/0/#sent/19b...",
369+
}
365370
```
366371

367372
</Tabs.Tab>
@@ -375,7 +380,7 @@ In this simple example, we call the tool methods directly. In your real applicat
375380

376381
## Example Code
377382

378-
<Tabs items={["Python", "JavaScript"]} storageKey="preferredLanguage">
383+
<Tabs items={["Python", "TypeScript"]} storageKey="preferredLanguage">
379384

380385
<Tabs.Tab>
381386

@@ -461,7 +466,7 @@ print(response_send_email.output.value)
461466
</Tabs.Tab>
462467
<Tabs.Tab>
463468

464-
```javascript filename="example.mjs"
469+
```typescript filename="example.ts"
465470
import Arcade from "@arcadeai/arcadejs";
466471

467472
// You can also set the `ARCADE_API_KEY` environment variable instead of passing it as a parameter.

0 commit comments

Comments
 (0)