The Tailor Platform SDK provides a streamlined deployment workflow using theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tailor-platform/sdk/llms.txt
Use this file to discover all available pages before exploring further.
apply and remove commands. This guide covers how deployment works, workspace management, and best practices for production deployments.
Deployment Workflow
The basic deployment workflow consists of two main commands:The Apply Command
Theapply command deploys your application to a Tailor Platform workspace:
Configuration Loading
The SDK reads
tailor.config.ts and loads all service definitions from the specified file patterns.Schema Validation
Validates TailorDB schema changes against migration snapshots (unless
--no-schema-check is specified).Apply Options
Target workspace ID for deployment. Can also be set via
TAILOR_PLATFORM_WORKSPACE_ID environment variable.Workspace profile name. Profiles combine user credentials and workspace IDs.
Path to SDK configuration file.
Skip confirmation prompts. Useful for CI/CD pipelines.
Run the command without making any changes. Shows what would be deployed.
Skip schema diff check against migration snapshots. Not recommended for production.
Disable bundle caching for this run.
Clean the bundle cache before building.
The Remove Command
Theremove command removes all resources managed by your application from the workspace:
Workspaces
Workspaces are isolated environments for your applications. Each workspace has its own:- Database instances
- Deployed services (resolvers, executors, workflows)
- Auth and IdP configurations
- Static websites
- Secrets and environment variables
Creating Workspaces
Create a new workspace:Workspace name.
Workspace region. Options:
us-west, asia-northeast.Enable delete protection to prevent accidental deletion.
Automatically create a profile for this workspace.
Listing Workspaces
Deleting Workspaces
Profiles
Profiles combine user credentials and workspace IDs for easier deployment management:Creating Profiles
Using Profiles
Deploy using a profile:Listing Profiles
Environment Management
Environment Variables in Config
Define environment variables intailor.config.ts:
tailor.config.ts
Loading from .env Files
Load environment variables from files during deployment:Environment files follow Node.js
--env-file behavior:- Variables already set in the environment are not overwritten
- Later files override earlier files
--env-filefiles are loaded first, then--env-file-if-existsfiles
Environment Variable Priority
Environment variables are resolved in this order:- Variables already set in the shell environment
- Variables from
--env-file(in order specified) - Variables from
--env-file-if-exists(in order specified) - Variables defined in
tailor.config.ts
Migration Handling
When database migrations are configured,apply automatically handles migration execution:
tailor.config.ts
Migration Execution Flow
Schema Verification
By default,apply performs two verification steps:
Local Schema Check
Local Schema Check
Verifies that local schema changes match the migration files. This ensures migrations are properly generated before deployment.
Remote Schema Check
Remote Schema Check
Verifies that the remote schema matches the expected state based on migration history. This detects schema drift caused by manual changes or other developers.
Authentication
Login to Tailor Platform
Authentication Priority
Authentication tokens are resolved in this order:TAILOR_PLATFORM_TOKENenvironment variableTAILOR_TOKENenvironment variable (deprecated)- Profile specified via
--profileoption orTAILOR_PLATFORM_PROFILE - Current user from platform config (
~/.config/tailor-platform/config.yaml)
Using Personal Access Tokens
For CI/CD pipelines, use personal access tokens:CI/CD Best Practices
Example GitHub Actions Workflow
.github/workflows/deploy.yml
Deployment Checklist
- Migrations are generated and committed
- Environment variables are configured
- Target workspace is correct
- Authentication is set up (profile or token)
- Tests pass locally
- Schema changes are reviewed
- Dry-run deployment succeeds
Next Steps
Configuration
Learn about tailor.config.ts structure
Type Safety
Understand TypeScript type flow