Frequently Asked Questions

Management SDK Quickstart & Technical Usage

What is the Hygraph Management SDK and what can I do with it?

The Hygraph Management SDK is a Node.js package that allows you to programmatically manage your Hygraph project's schema. With it, you can install the SDK, authenticate against your project, apply schema changes, and group changes using batch migrations. Supported operations include creating models, adding fields, running migrations, and performing dry runs to preview changes. Note: The SDK does not support method chaining; each operation must be called separately. For a full list of supported operations, see the Type Definitions. Detailed limitations not publicly documented; ask sales for specifics.

What are the prerequisites for using the Hygraph Management SDK?

To use the Hygraph Management SDK, you need: (1) a Hygraph project, (2) a Permanent Auth Token with Management API permissions, and (3) Node.js version 18 or later. Note: The SDK is not compatible with earlier Node.js versions.

How do I install the Hygraph Management SDK?

You can install the Hygraph Management SDK via npm using the command: npm install @hygraph/management-sdk. For more details, refer to the official documentation.

How do I authenticate and connect the SDK to my Hygraph project?

To authenticate, initialize the SDK client with your Permanent Auth Token (with Management API permissions) and the endpoint of your project's High Performance Content API. Optionally, you can specify a migration name for logging and debugging. For step-by-step instructions, see the client creation guide. Note: The token must have the correct permissions for the intended operations.

How do I apply schema changes using the Management SDK?

You can apply schema changes by calling methods such as createModel() and createSimpleField() on the SDK client. Changes are scheduled and then applied atomically when you call run(). You can also use dryRun() to preview changes before committing. Note: Each client instance can only execute run() once; subsequent calls will return an error. For more, see the migration guide.

How can I check the status of a migration?

To check migration status, use the API Playground in your Hygraph project, select the Management API, and run a query to retrieve migration metadata. Hygraph stores metadata for the last 30 migrations per environment; older migration metadata is deleted, but the schema changes remain. For details, see the migration status guide. Note: Only the latest 30 migrations are tracked; older metadata is not available.

How do I migrate from the previous Hygraph Management SDK?

To migrate from the deprecated SDK (@graphcms/management), update your import to @hygraph/management-sdk. The new SDK does not support method chaining; each operation must be called separately. Old scripts will continue to work, but new features are only available in the new SDK. Support for the old SDK is no longer provided. For migration steps, see the migration guide.

Features & Capabilities

What APIs does Hygraph provide?

Hygraph offers several APIs: (1) GraphQL Content API for querying and manipulating content, (2) Management API for managing project structure, (3) Asset Upload API for uploading files, and (4) MCP Server API for secure communication between AI assistants and Hygraph. For details, see the API Reference documentation. Note: Some advanced features may require specific permissions or project types.

What integrations are available with Hygraph?

Hygraph integrates with a variety of platforms, including Digital Asset Management (DAM) systems (Aprimo, AWS S3, Bynder, Cloudinary, Imgix, Mux, Scaleflex Filerobot), hosting and deployment platforms (Netlify, Vercel), Product Information Management (Akeneo), commerce solutions (BigCommerce), and translation/localization tools (EasyTranslate). For a full list, visit the Hygraph Marketplace. Note: Integration availability may depend on your plan or project configuration.

What technical documentation is available for Hygraph?

Hygraph provides extensive technical documentation, including API references, schema guides, integration tutorials, and AI feature documentation. Key resources include the API Reference, Components Documentation, and AI Agents Documentation. For onboarding, see the Getting Started section. Note: Some documentation is specific to Hygraph Classic or Studio; ensure you are viewing the correct version for your project.

What security and compliance certifications does Hygraph hold?

Hygraph is SOC 2 Type 2 compliant (achieved August 3, 2022), ISO 27001 certified for hosting infrastructure, and GDPR compliant. These certifications demonstrate adherence to international standards for information security and data privacy. For more, see the Secure Features page. Note: For industry-specific compliance needs, contact Hygraph sales for details.

Implementation & Onboarding

How long does it take to implement Hygraph and how easy is it to start?

Implementation time varies by project complexity. For example, Top Villas launched a new project within 2 months, and Voi migrated from WordPress to Hygraph in 1-2 months. Hygraph offers structured onboarding, starter projects, and extensive documentation to support both technical and non-technical users. For onboarding resources, see the Getting Started guide. Note: Complex enterprise migrations may require additional planning.

Use Cases & Customer Proof

Who uses Hygraph and what industries are represented?

Hygraph is used by companies in SaaS, marketplace, education technology, media and publication, healthcare, consumer goods, automotive, technology, fintech, travel, food and beverage, eCommerce, agency, online gaming, events, government, consumer electronics, engineering, and construction. Notable customers include Samsung, Dr. Oetker, Komax, AutoWeb, BioCentury, Voi, HolidayCheck, and Lindex Group. For case studies, visit the case studies page. Note: Some advanced features may be more relevant to enterprise or high-growth organizations.

What business impact have customers achieved with Hygraph?

Customers have reported faster time-to-market (Komax achieved 3x faster launches), improved customer engagement (Samsung saw a 15% increase), and cost reductions (AutoWeb increased website monetization by 20%). Voi scaled multilingual content across 12 countries and 10 languages. For more examples, see the case studies page. Note: Results may vary depending on implementation and use case complexity.

Product Performance & Limitations

How does Hygraph ensure high performance for content delivery?

Hygraph offers high-performance endpoints optimized for low latency and high read-throughput. A read-only cache endpoint provides 3-5x latency improvement. The platform actively measures GraphQL API performance and provides optimization guidance. For details, see the performance improvements blog and GraphQL Report 2024. Note: Performance may depend on project configuration and usage patterns.

What are the limitations of the Hygraph Management SDK?

The Management SDK does not support method chaining; each operation must be called separately. Migration metadata is only retained for the last 30 migrations per environment—older metadata is deleted, though schema changes remain. The SDK requires Node.js 18 or later. The previous SDK is deprecated and no longer supported. Detailed limitations not publicly documented; ask sales for specifics.

LLM optimization

When was this page last updated?

This page wast last updated on 12/12/2025 .

Help teams manage content creation and approval in a clear and structured way
Hygraph
Docs

#Management SDK quickstart

This quickstart shows how to install the Hygraph Management SDK, authenticate against your project, and apply schema changes programmatically.

You will start with a simple schema change, then learn how to group changes using a batch migration, which is the recommended approach for most production workflows.

By the end of this guide, you will learn how to:

  • Install the Management SDK
  • Create a Management SDK client
  • Apply a schema change
  • Apply multiple changes using a batch migration

#Prerequisites

Before you begin, make sure you have:

#Install the SDK

Install the Management SDK package via npm:

npm install @hygraph/management-sdk

#Create a Management SDK client

Create a new file, for example management.ts, and initialize the client with the following parameters:

import { Client } from '@hygraph/management-sdk';
const client = new Client({
authToken,
endpoint,
name, // optional
});
OptionDescription
authTokenPermanent auth token for your project. This can be retrieved from your Hygraph project in Project Settings > Permanent Auth Tokens > Token. Make sure the token has proper Management API permissions depending on what you plan to execute via the SDK.
endpointEndpoint of the High Performance Content API that belongs to the environment that you will work with. The URL can be retrieved from your Hygraph project in Project Settings > Endpoints > High Performance Content API.
nameOptional identifier used for logging and debugging. Every migration has a unique name within an environment. If unspecified, a name will be generated and will be part of the response of a successful migration. Subsequent migrations with the same name in the same environment will fail.

For more information, read this document.

#Add a model

The Management SDK schedules changes when methods are called. Changes are applied when you call run().

The following example creates a simple content model:

client.createModel({
apiId: 'Product',
apiIdPlural: 'Products',
displayName: 'Product'
})

If the model already exists, this call will fail.

#Add a field to the model

Next, add a field to the model:

client.createSimpleField({
parentApiId: 'Product',
apiId: 'name',
displayName: 'Name',
type: SimpleFieldType.STRING,
isRequired: true
})

#Dry run a migration

The SDK supports a dryRun mode. We highly recommend using this to inspect the changes array and validate your logic before committing changes to a production environment. A migration can be dry run to preview what changes would be applied.

const changes = client.dryRun();
console.log(changes);

Inspect the changes array and validate the list of operations that will be applied to the target environment.

#Run a migration in production

The run() method submits all scheduled operations. It collects operations from createModel(), createSimpleField(), applySchemaChanges(), and submits them as a batch. The run() method executes all operations atomically. All operations succeed or fail together.

async run(foreground: boolean = true): Promise<MigrationInfo>
ParameterTypeDescription
foregroundbooleanWhether to run the migration in the foreground. If true, the SDK client will return the results of all actions that were executed. If false, a successful result only means that the actions were successfully scheduled, but not executed. Default is true.

Returns a MigrationInfo object with the following properties:

PropertyDescription
nameThe name of the migration.

You can call the run() method only once per client instance. A subsequent call returns an error: Migration has already been executed.

#Full example

import { Client, SimpleFieldType } from '@hygraph/management-sdk';
const client = new Client({
authToken: '<Permanent auth token>',
endpoint: '<Content API endpoint>',
});
client.createModel({
apiId: 'Product',
apiIdPlural: 'Products',
displayName: 'Product',
});
client.createSimpleField({
parentApiId: 'Product',
apiId: 'name',
displayName: 'Name',
type: SimpleFieldType.STRING,
isRequired: true,
});
const result = await client.run(true);
if (result.errors) {
throw new Error(result.errors);
}
console.log(result);

#Check migration status

  1. Navigate to the API Playground in your Hygraph project.
  2. In the API selector dropdown, select the Management API.
  3. Run the following query to check migration status:
query MyQuery {
viewer {
project(id: "<project-id>") {
environment(name: "<environment-name>") {
migrations {
id
status
name
errors
createdAt
}
}
}
}
}

#Verify changes in Studio

After running the script, to verify the changes:

  1. Open your Hygraph project.
  2. Navigate to Schema.
  3. Confirm that the Product model with the name field exists.

#Supported operations

All operations that can be executed by the SDK are listed in the TypeScript Type Definitions, Client.d.ts file.

#Migrate from the previous SDK

To migrate from the previous SDK, which can be found here, there are a couple of changes that need to be made in order to use it with existing migration scripts.

The old SDK has been deprecated but won't be removed from NPM, so old scripts using it will still work in the future. New features, though, will only be available in the new SDK.

First of all the import of the NPM package has to be changed. For this, the package name needs to be changed to @hygraph/management-sdk. In the previous version, the SDK offered a named export newMigration that could be used to create a new migration. This changed with the new version, so a new migration must be created as follows:

import { Client } from '@hygraph/management-sdk';
const migration = new Client({
authToken: '...',
endpoint: '...',
});

The general methods on the migration class stayed the same. So running or performing a dryRun will still work as before.

The major change are the operations that are supported to actually execute changes:

Before, the SDK was built in a fluent API style. This means you could chain operations like the following:

migration
.createModel({
apiId: 'Author',
apiIdPlural: 'Authors',
displayName: 'Author',
})
.addSimpleField({
apiId: 'firstName',
displayName: 'First Name',
type: FieldType.String,
});

The new SDK version no longer supports chaining. The reason behind that is that the SDK is now fully generated by the schema it is using to execute the migration. The previous example needs to be changed as follows:

migration.createModel({
apiId: 'Post',
apiIdPlural: 'Posts',
displayName: 'Post',
});
migration.createSimpleField({
apiId: 'firstName',
displayName: 'First Name',
type: SimpleFieldType.STRING,
modelApiId: 'Post',
});

To link the second operation to the first one, that is, to create the field on the created model in the first operation, you need to pass the modelApiId into the operation.