Skip to content

Commit fb43406

Browse files
authored
chore(api): document window.__TAURI__ option and allowlist (tauri-apps#223)
1 parent bce8317 commit fb43406

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/en/api/js/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ hide_title: true
77

88
# @tauri-apps/api
99

10+
The `@tauri-apps/api` package is a JavaScript interface to the Tauri API.
11+
It is written in TypeScript and allows you to call core APIs and your own commands.
12+
Note that some APIs must be enabled under `tauri.conf.json > tauri > allowlist`, and each module explains the configuration.
13+
14+
If you are not using a module bundler, you can use this API as a `window.__TAURI__` object by enabling it on `tauri.conf.json > build > withGlobalTauri`.
15+
1016
## Table of contents
1117

1218
### Modules

docs/en/usage/guides/command.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Now, you can invoke the command from your JS code:
3535
```js
3636
// With the Tauri API npm package:
3737
import { invoke } from '@tauri-apps/api/tauri'
38-
// With the Tauri global script:
38+
// With the Tauri global script, enabled when `tauri.conf.json > build > withGlobalTauri` is set to true:
3939
const invoke = window.__TAURI__.invoke
4040

4141
// Invoke the command

0 commit comments

Comments
 (0)