Skip to main content
Use segments.retrieve to get a read-safe Segment status and membership count. Use segments.preview when you need a fresh matched-profile count before scheduling a Broadcast.
import Segmentflow from "@segmentflow/segmentflow-typescript";

const client = new Segmentflow({ apiKey: process.env.SEGMENTFLOW_API_KEY });

const segment = await client.v1.segments.retrieve("vip-customers");
const preview = await client.v1.segments.preview("vip-customers");