Skip to content

Node.js - Existing Instance

ExistingInstanceManager allows you to create a new Smelter instance that will connect to already running smelter server. This manager assumes that it is the only instance that connects to a specific smelter server.

ExistingInstanceManagerExample.tsx
import Smelter, { ExistingInstanceManager } from "@swmansion/smelter-node"
async function run() {
const manager = new ExistingInstanceManager({
ip: "127.0.0.1",
port: 8000,
protocol: 'https',
});
const smelter = new Smelter(manager);
await smelter.init()
}
void run();

ExistingInstanceOptions

Type definitions

type ExistingInstanceOptions = {
port: number;
ip: string;
protocol: 'http' | 'https';
};

Properties

ip

IP of a running smelter server.

  • Type: string

port

Port number where smelter API endpoint is exposed.

  • Type: number

protocol

Protocol for connection. It also implies protocol of a WebSocket connection (http -> ws and https -> wss).

  • Type: 'http' | 'https'