Skip to main content
This guide provides practical examples of using the Basalt SDK for common prompt management scenarios. These examples demonstrate how to use the get, list, and describe methods effectively in your applications.

Getting Prompts

Basic Prompt Retrieval

The simplest way to get a prompt is by its slug:

Getting a Specific Version

When you need a specific version of a prompt:

Using Environment-Specific Tags

Get prompts with different tags based on your environment:

Replacing Variables

Replace placeholder variables with actual values:

Combining Multiple Parameters

Use multiple parameters together for precise control:

Listing Prompts

List All Prompts

Get a list of all available prompts:

List Prompts by Feature

Get prompts that belong to a specific feature:

Finding and Filtering Prompts

List prompts and then filter them programmatically:

Finding Prompts with Specific Tags

List prompts and filter by available tags:

Describing Prompts

Get Basic Prompt Details

Get detailed information about a prompt:

Extract Variable Names and Types

Get information about a prompt’s variables:

Check Available Versions

Get information about available versions of a prompt:

Practical Application Examples

Building a Prompt Selection UI

Use list and describe to build a prompt selection interface:

Implementing a Prompt-Based Workflow

Chain multiple prompts together for a workflow:

Feature Flag Integration

Use prompt tags as feature flags: