The messages API allows you to send custom notices in the Replit workspace.

Usage

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

Methods

messages.showConfirm

Shows a confirmation toast message within the Replit workspace for length milliseconds. Returns the ID of the message as a UUID
showConfirm(str: string, length: number): Promise<string>

messages.showError

Shows an error toast message within the Replit workspace for length milliseconds. Returns the ID of the message as a UUID
showError(str: string, length: number): Promise<string>

messages.showNotice

Shows a notice toast message within the Replit workspace for length milliseconds. Returns the ID of the message as a UUID
showNotice(str: string, length: number): Promise<string>

messages.showWarning

Shows a warning toast message within the Replit workspace for length milliseconds. Returns the ID of the message as a UUID
showWarning(str: string, length: number): Promise<string>

messages.hideMessage

Hides a message by its IDs
hideMessage(id: string): Promise<void>

messages.hideAllMessages

Hides all toast messages visible on the screens
hideAllMessages(): Promise<void>