Configuration¶
nsyte uses a configuration file to store your settings. This guide explains all available configuration options and how to use them.
Configuration File¶
The configuration is stored in .nsite/config.json in your project directory. This file is created
when you run nsyte init and can be modified manually or through the CLI.
Basic Configuration¶
Here's a basic configuration file with all available options:
{
"bunkerPubkey": "abc123...",
"relays": ["wss://relay.damus.io", "wss://nos.lol"],
"servers": ["https://blossom.server"],
"publishProfile": true,
"publishRelayList": true,
"publishServerList": true,
"profile": {
"name": "My Name",
"display_name": "Display Name",
"about": "Description of myself",
"picture": "https://example.com/avatar.jpg",
"banner": "https://example.com/banner.jpg",
"website": "https://mysite.com",
"nip05": "me@mysite.com",
"lud16": "me@getalby.com"
},
"publishAppHandler": true,
"appHandler": {
"id": "my-app-handler",
"kinds": [1, 30023],
"name": "My Event Viewer",
"description": "Views notes and articles",
"platforms": {
"web": {
"patterns": [
{ "url": "https://myapp.com/e/<bech32>", "entities": ["nevent", "note"] },
{ "url": "https://myapp.com/a/<bech32>", "entities": ["naddr"] }
]
}
}
},
"fallback": "/index.html"
}
Configuration Options¶
Authentication¶
bunkerPubkey: Your nostr bunker public key (if using NIP-46)privateKey: Your nostr private key (if not using bunker)
Relays and Servers¶
relays: Array of WebSocket URLs for nostr relaysservers: Array of HTTP(S) URLs for blossom serverspublishRelayList: Whether to publish the relay list as kind 10002 (default: false, root sites only)publishServerList: Whether to publish the Blossom server list as kind 10063 (default: false, root sites only)
Profile Metadata¶
publishProfile: Whether to publish profile metadata as kind 0 (default: false, root sites only)profile.name: Your nameprofile.display_name: Your display nameprofile.about: A description about yourselfprofile.picture: URL to your avatar imageprofile.banner: URL to your banner/header imageprofile.website: Your website URLprofile.nip05: Your NIP-05 identifier (e.g.,user@domain.com)profile.lud16: Your Lightning address for receiving payments (e.g.,user@getalby.com)profile.lud06: Legacy Lightning address (LNURL)
Routing¶
fallback: The HTML file to use for client-side routing (e.g.,/index.htmlfor SPAs)
Root Site Only Metadata¶
Profile, relay list, and server list are user-level metadata and can only be published from
root sites (where id is null, "", or unset). Named sites cannot publish these to prevent
conflicts.
Root site (can publish user metadata):
{
"id": null,
"publishProfile": true,
"publishRelayList": true,
"publishServerList": true,
"profile": {
"name": "My Name"
}
}
Named site (cannot publish user metadata):
If you try to publish user-level metadata from a named site, you'll get a validation error during
nsyte deploy.
NIP-89 App Handler¶
publishAppHandler: Whether to publish app handler announcement (default: false)appHandler.id: Unique identifier for this handler (required for root sites)-
appHandler.kinds: Array of event kind numbers this nsite can handle -
appHandler.name: Optional display name for your handler appHandler.description: Optional description of what your handler doesappHandler.platforms: Platform-specific handler configurationsplatforms.web.patterns: Array of custom URL patterns for web handlingurl: Full URL pattern with<bech32>placeholderentities: Supported entity types (nevent,naddr,nprofile, etc.)
platforms.android: Android app intent URL or package nameplatforms.ios: iOS app URL scheme or universal linkplatforms.macos: macOS app URL scheme or bundle identifierplatforms.windows: Windows app protocol or executable pathplatforms.linux: Linux app command or desktop file
Environment Variables¶
You can also configure nsyte using environment variables:
NSITE_CONFIG: Path to configuration file (default:.nsite/config.json)NSITE_RELAYS: Comma-separated list of relay URLsNSITE_SERVERS: Comma-separated list of server URLsNSITE_BUNKER: Bunker connection stringNSITE_NBUNKSEC: nbunksec string for authentication
Ignoring Files¶
Create a .nsyte-ignore file in your project root to specify files and directories that should be
excluded from uploads. This uses standard glob syntax:
Default Ignore Patterns¶
nsyte automatically ignores:
.git/**.DS_Storenode_modules/**.nsyte-ignore.nsite/config.json.vscode/**
Configuration Management¶
Viewing Configuration¶
To view your current configuration:
Updating Configuration¶
You can update your configuration in several ways:
- Using the CLI:
- Editing the file directly:
- Using environment variables:
Best Practices¶
- Security
- Never commit
.nsite/config.jsonto version control if it contains sensitive data - Use bunker authentication for better security
- Use encrypted storage or OS keychain for bunker credentials
-
Rotate keys periodically
-
Performance
- Use multiple relays for redundancy
- Choose relays close to your users
- Use CDN servers when possible
-
Enable caching in production deployments
-
Maintenance
- Keep your configuration in version control (excluding sensitive data)
- Document your configuration choices
- Review and update regularly
- Use
nsyte validateto check configuration before deployment
Troubleshooting¶
Common Issues¶
- Configuration Not Found
- Run
nsyte initto create the configuration - Check file permissions
-
Verify the path in
NSITE_CONFIG -
Authentication Errors
- Verify your keys
- Check bunker connection
-
Ensure proper permissions
-
Upload Failures
- Check relay connectivity
- Verify server URLs
- Review ignore patterns
Next Steps¶
- Learn about deployment options
- Set up CI/CD integration
- Review security best practices