# @endo/init

> Prepare Endo environment on import

Latest version **1.1.13** (published 2026-02-26) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @endo/init
pnpm add @endo/init
yarn add @endo/init
bun add @endo/init
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.1.13 |
| Published | 2026-02-26 |
| First published | 2022-01-23 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 33 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1051 |
| Author | Endo contributors |
| Maintainers | kriskowal, michaelfig, erights, warner, mhofman, boneskull, naugtur |

## Links

- npm: https://www.npmjs.com/package/@endo/init
- Repository: https://github.com/endojs/endo
- Homepage: https://github.com/endojs/endo#readme
- Issues: https://github.com/endojs/endo/issues
- npm.io page: https://npm.io/package/@endo/init

## Dependencies (5)

- [@endo/base64](https://npm.io/package/@endo/base64.md) ^1.0.12
- [@endo/harden](https://npm.io/package/@endo/harden.md) ^1.1.0
- [@endo/lockdown](https://npm.io/package/@endo/lockdown.md) ^1.0.18
- [@endo/promise-kit](https://npm.io/package/@endo/promise-kit.md) ^1.2.0
- [@endo/eventual-send](https://npm.io/package/@endo/eventual-send.md) ^1.4.0

## Recent versions

- 1.1.13 (latest) — 2026-02-26
- 1.1.12 — 2025-07-12
- 1.1.11 — 2025-06-17
- 1.1.10 — 2025-06-02
- 1.1.9 — 2025-03-24
- 1.1.8 — 2025-01-24
- 1.1.7 — 2024-11-13
- 1.1.6 — 2024-10-22
- 1.1.5 — 2024-10-10
- 1.1.4 — 2024-08-27
- 1.1.3 — 2024-07-30
- 1.1.2 — 2024-05-07
- 1.1.1 — 2024-04-04
- 1.1.0 — 2024-03-20
- 1.0.4 — 2024-02-23
- … 34 more at https://npm.io/package/@endo/init/versions

## README

# `@endo/init`

Importing `@endo/init` sets up an Endo JavaScript realm.
This includes setting up HardenedJS, including locking it down,
sets the realm up for [Eventual Send](../eventual-send),
ensures that `atob` and `btoa` are present, and ensures that promises can be
hardened regardless of the platform.

By default, the environment is fully locked down and as safe as we can make it
for cotenant host and guest programs.

```js
import '@endo/init';
```

---

The `@endo/init/debug.js` makes a less safe environment which is more conducive
to debugging.

The default `"safe"` `errorTaming` option for SES's `lockdown`, if possible,
redacts the stack trace from error instances, so that it is not available
merely by expressing `errorInstance.stack`.
However, some tools like the Ava testing library, will look for the stack there
and become less useful if it is missing.
The `@endo/ses-ava` package compensates for the case of Ava specifically,
but `@endo/init/debug.js` may be necessary for other tools.

The default `"concise"` mode of the `stackFiltering` option to SES's `lockdown`
usually makes a better debugging experience, by severely reducing the noisy
distractions of the normal verbose stack traces.

The default `"moderate"` mode for `overrideTaming` option to SES's `lockdown`
does not hurt the debugging experience much.
But, it will introduce noise into, for example, the VSCode debugger's object
inspector.
During debugging and testing, if you can avoid legacy code that needs the
`'moderate'` setting, then the `'min'` setting reduces noise yet further, by
turning fewer inherited properties into accessors.

```js
import '@endo/init/debug.js';
```

---

Avoid using `@endo/init/unsafe-fast.js`.
It is an extreme measure we hope to obviate.

```js
import '@endo/init/unsafe-fast.js';
```

---
_Source: https://npm.io/package/@endo/init · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
