Skip to main content

init API

The init() method initializes the Extension, establishes a handshake with the Repl, and adds an event listener to the window object. It takes as an argument an object containing optional parameters for the initialization process. It returns a function that removes the event listener added to the window object.

Usage

import { init } from '@replit/extensions';

Signature

init(args: ReplitInitArgs): Promise<ReplitInitOutput>

Types

HandshakeStatus

An enumerated set of values for the Handshake between the workspace and an extension

PropertyType

ReplitInitArgs

The Replit init() function arguments

PropertyType
timeout?number

ReplitInitOutput

The output of the Replit init() function

PropertyType
disposeFunction
statusHandshakeStatus

HandshakeStatus

An enumerated set of values for the Handshake between the workspace and an extension

Error = 'error'
Loading = 'loading'
Ready = 'ready'
Was this helpful?