Loads, validates, and normalizes netlify.toml with context/branch resolution, environment variable merging, and Netlify API integration.
# Netlify Config
This library loads, validates, and normalizes the Netlify configuration.
Netlify can be configured:
- In the [build settings](https://docs.netlify.com/configure-builds/get-started/).
- In a [`netlify.toml`](https://docs.netlify.com/configure-builds/file-based-configuration/) file in the repository root
directory or site `base` directory.
# Install
```bash
npm install @netlify/config
```
# Usage (Node.js)
## resolveConfig(options?)
`options`: `object?`\
_Return value_: `Promise<object>`
```js
import { resolveConfig } from '@netlify/config'
const exampleFunction = async function () {
const { config, configPath, buildDir, context, branch, token, siteInfo } = await resolveConfig(options)
// {
// "siteInfo": {
// "id": "418b94bc-93cd-411a-937a-ae4c734f17c4
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key