Segment
Instead of following these steps manually, you can use the AI Credential Assistant — describe what you want to connect and the AI will walk you through the setup step by step, tailored to your account.
Overview
Connect your Segment account to Nirvai to send customer data, track events, and integrate with your analytics pipeline.
Supported Authentication Methods
- API Key (Write Key) - Source-specific write key for sending data
Prerequisites
- A Segment account
- A Source created in your Segment workspace
Setup Instructions
API Key Authentication
Step 1: Create a Source
- Log in to your Segment account
- Go to Connections > Sources
- Click Add Source
- Select Node.js (or appropriate server-side source)
- Name your source and click Add Source
Step 2: Get Your Write Key
- Open your newly created source
- Go to the Settings tab
- Find and copy the Write Key
Step 3: Configure in Nirvai
- In Nirvai, select Segment API
- Paste your Write Key
- Save the credential
How Authentication Works
Segment uses the Write Key as a Basic Auth username (with empty password):
Authorization: Basic base64(writekey:)
Nirvai handles this encoding automatically.
Available Operations
With Segment credentials, you can:
- Track user events and actions
- Identify users with traits
- Group users into organizations
- Send page/screen views
- Manage user aliases
- Forward data to integrations
Best Practices
Source Organization
- Create separate sources for different environments (dev, staging, prod)
- Use meaningful source names for easy identification
- Each source has its own Write Key
Data Quality
- Follow Segment's naming conventions for events
- Include consistent properties across events
- Use identify calls before track calls
Troubleshooting
Common Issues
- 401 Unauthorized: Write Key is invalid or from wrong source
- Data Not Appearing: Check source debugger in Segment dashboard
- Wrong Destination: Verify integration settings in your source
- Rate Limits: Batch events when possible for high-volume sources
Debugging Tips
- Use Segment's Source Debugger to verify events
- Check the Delivery Overview for destination status
- Validate event schema in Event Tester
Related Resources
Adapted from n8n documentation for Nirvai platform
Next Steps
Use the AI Tool Creator to turn this credential into agent-callable tools. Describe what your agent should be able to do and the AI investigates the API, configures the endpoints, and gives you a reviewable toolkit before saving anything.