Skip to content

Quickstart

Get started with SelectNetworx in under 5 minutes.

Prerequisites

Before you begin, make sure you have:

  • A SelectNetworx account (sign up here)
  • Your API key from the dashboard
  • Node.js 18+ or Python 3.8+ installed

INFO

Your API key should be kept secure and never exposed in client-side code or public repositories.

Step 1: Install the SDK

Choose your preferred language and install the SelectNetworx SDK:

bash
npm install @selectnetworx/sdk
bash
yarn add @selectnetworx/sdk
bash
pnpm add @selectnetworx/sdk
bash
pip install selectnetworx
bash
go get github.com/selectnetworx/go-sdk

Step 2: Initialize the Client

Create a new client instance with your API key:

javascript
import { SelectNetworx } from '@selectnetworx/sdk';

const client = new SelectNetworx({
  apiKey: process.env.SELECTNETWORX_API_KEY,
});
python
from selectnetworx import SelectNetworx
import os

client = SelectNetworx(
    api_key=os.environ.get("SELECTNETWORX_API_KEY")
)
go
package main

import (
    "os"
    selectnetworx "github.com/selectnetworx/go-sdk"
)

func main() {
    client := selectnetworx.NewClient(
        os.Getenv("SELECTNETWORX_API_KEY"),
    )
}

WARNING

Never hardcode your API key directly in your source code. Always use environment variables or a secure secrets manager.

Step 3: Make Your First API Call

Now let's make a simple API call to verify everything is working:

javascript
async function main() {
  const response = await client.networks.list();
  console.log('Networks:', response.data);
}

main();
python
def main():
    response = client.networks.list()
    print("Networks:", response.data)

if __name__ == "__main__":
    main()
go
func main() {
    response, err := client.Networks.List()
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println("Networks:", response.Data)
}

Step 4: Create a Network

Let's create your first network:

javascript
const network = await client.networks.create({
  name: 'my-first-network',
  region: 'us-east-1',
  cidr: '10.0.0.0/16',
});

console.log('Created network:', network.id);
python
network = client.networks.create(
    name="my-first-network",
    region="us-east-1",
    cidr="10.0.0.0/16"
)

print(f"Created network: {network.id}")
go
network, err := client.Networks.Create(&selectnetworx.NetworkCreateParams{
    Name:   "my-first-network",
    Region: "us-east-1",
    CIDR:   "10.0.0.0/16",
})
if err != nil {
    log.Fatal(err)
}

fmt.Printf("Created network: %s\n", network.ID)

TIP

Use descriptive names for your networks to make them easier to manage as your infrastructure grows.

Next Steps

Congratulations! You've successfully set up SelectNetworx and created your first network. Here's what you can explore next:

Troubleshooting

Authentication Error (401)

Make sure your API key is correct and hasn't expired. You can regenerate your API key from the dashboard.

Rate Limit Exceeded (429)

You've exceeded your plan's rate limits. Consider upgrading your plan or implementing exponential backoff in your requests.

Network Creation Failed

Ensure the CIDR block you're using doesn't overlap with existing networks in your account. Also verify that the region is available for your account type.

Built with VitePress