|
| 1 | +--- |
| 2 | +sidebar_label: 'Create a New User' |
| 3 | +--- |
| 4 | + |
| 5 | +# Creating Your First Naptha User Account |
| 6 | + |
| 7 | +## What is a Naptha User Account? |
| 8 | + |
| 9 | +Your Naptha account is your identity on the Naptha platform. It allows you to: |
| 10 | +- Deploy and manage agents, tools, environments and other modules on the Naptha Hub |
| 11 | +- Access and interact with the Naptha Hub's features and services |
| 12 | + |
| 13 | +This guide will walk you through the process of creating your first Naptha user account step by step. |
| 14 | + |
| 15 | +<details> |
| 16 | +<summary>Prerequisites</summary> |
| 17 | + |
| 18 | +Before we begin, ensure you have: |
| 19 | +- Python 3.8 or higher installed |
| 20 | +- Poetry package manager (`pipx install poetry`) |
| 21 | +- Basic familiarity with command line tools |
| 22 | +- Git installed |
| 23 | +</details> |
| 24 | + |
| 25 | +## 1. Getting Started |
| 26 | + |
| 27 | +### Install the SDK |
| 28 | +First, clone and install the Naptha SDK: |
| 29 | +```bash |
| 30 | +git clone https://github.com/NapthaAI/naptha-sdk.git |
| 31 | +cd naptha-sdk |
| 32 | +poetry install |
| 33 | +poetry shell |
| 34 | +cp .env.example .env #set up your environment variables |
| 35 | +``` |
| 36 | + |
| 37 | +## 2. Creating Your Account |
| 38 | + |
| 39 | +You have two methods to choose from: |
| 40 | + |
| 41 | +### Method 1: Interactive Signup (Recommended) |
| 42 | + |
| 43 | +The simplest way to create a new account is through the interactive CLI. Run the following command: |
| 44 | +```bash |
| 45 | +naptha signup |
| 46 | +``` |
| 47 | + |
| 48 | +This will: |
| 49 | +- Guide you through username/password creation |
| 50 | +- Generate your cryptographic public/private keypair |
| 51 | +- Automatically save your credentials to the .env file |
| 52 | + |
| 53 | +### Method 2: Pre-configured Setup |
| 54 | +If you prefer setting credentials beforehand: |
| 55 | + |
| 56 | +1. Edit your `.env` file with your desired credentials: |
| 57 | + |
| 58 | + ```bash |
| 59 | + # .env file |
| 60 | + HUB_USERNAME=your_username |
| 61 | + HUB_PASSWORD=your_password |
| 62 | + PRIVATE_KEY=your_private_key # Optional - will be generated if not provided |
| 63 | + ``` |
| 64 | + |
| 65 | +2. Run signup: |
| 66 | + ```bash |
| 67 | + naptha signup |
| 68 | + ``` |
| 69 | + |
| 70 | +## 3. Verifying Your Setup |
| 71 | + |
| 72 | +### Check Available Nodes |
| 73 | +```bash |
| 74 | +naptha nodes |
| 75 | +``` |
| 76 | + |
| 77 | +### Try a Sample Agent |
| 78 | +```bash |
| 79 | +naptha run agent:hello_world_agent -p "firstname=sam surname=altman" |
| 80 | +``` |
| 81 | + |
| 82 | +### Verify Programmatically |
| 83 | +You can also verify the new credentials programmatically via the [client SDK](https://pypi.org/project/naptha-sdk/): |
| 84 | +```python |
| 85 | +from naptha_sdk.client.naptha import Naptha |
| 86 | +
|
| 87 | +async def verify_credentials(): |
| 88 | + try: |
| 89 | + async with Naptha() as naptha: |
| 90 | + await naptha.hub.signin(os.getenv("HUB_USERNAME"), os.getenv("HUB_PASSWORD")) |
| 91 | + return True |
| 92 | + except Exception as e: |
| 93 | + print(f"Credential verification failed: {str(e)}") |
| 94 | + return False |
| 95 | +``` |
| 96 | + |
| 97 | +## 4. Best Practices |
| 98 | + |
| 99 | +### Security |
| 100 | +- **Protect Your Private Key** |
| 101 | + - Never share your private key |
| 102 | + - Back up your `.env` file |
| 103 | + - Use environment variables in production |
| 104 | + |
| 105 | +- **Password Guidelines** |
| 106 | + - Use strong passwords (12+ characters) |
| 107 | + - Mix uppercase, lowercase, numbers, symbols |
| 108 | + - Avoid common words or patterns |
| 109 | + |
| 110 | +### Maintenance |
| 111 | +- Keep the SDK updated by fetching the latest version from GitHub or PyPI |
| 112 | +- Review registered agents periodically |
| 113 | + |
| 114 | +## Troubleshooting |
| 115 | + |
| 116 | +<details> |
| 117 | +<summary>Connection Issues</summary> |
| 118 | + |
| 119 | +If you're having trouble connecting: |
| 120 | +
|
| 121 | +1. Check your node URL in `.env`: |
| 122 | + ```bash |
| 123 | + # Local node |
| 124 | + NODE_URL=http://localhost:7001 |
| 125 | +
|
| 126 | + # Hosted node |
| 127 | + NODE_URL=http://node.naptha.ai:7001 |
| 128 | + ``` |
| 129 | +
|
| 130 | +2. Verify credentials: |
| 131 | + ```bash |
| 132 | + cat .env |
| 133 | + ``` |
| 134 | +</details> |
| 135 | +
|
| 136 | +<details> |
| 137 | +<summary>Authentication Issues</summary> |
| 138 | +
|
| 139 | +If you're having trouble authenticating: |
| 140 | +1. Ensure correct credentials in `.env` |
| 141 | +2. Try creating a new account with a different username and password and re-run the signup command: |
| 142 | + |
| 143 | + ```bash |
| 144 | + naptha signup |
| 145 | + ``` |
| 146 | +</details> |
| 147 | + |
| 148 | +## Next Steps |
| 149 | + |
| 150 | +Once your account is set up, you can: |
| 151 | + |
| 152 | +1. Explore available agents: |
| 153 | +```bash |
| 154 | +naptha agents |
| 155 | +``` |
| 156 | + |
| 157 | +2. Create your own agent: |
| 158 | +- Clone the [base template](https://github.com/NapthaAI/module_template?tab=readme-ov-file) |
| 159 | +- Follow the template instructions for prototyping, testing and deploying your agent |
| 160 | + |
| 161 | +:::info |
| 162 | +You can also follow our [Quick Guide to Creating and Publishing Your First Agent Module on Naptha](/Tutorials/module-guide) to create your |
| 163 | +own agent. |
| 164 | +::: |
| 165 | + |
| 166 | + |
| 167 | +## Need Help? |
| 168 | +- Join our [Discord Community](https://naptha.ai/naptha-community) |
| 169 | +- Follow us on [Twitter](https://twitter.com/NapthaAI) |
| 170 | +- Join us on [Farcaster](https://warpcast.com/naptha) |
| 171 | +- Get help with technical issues on [GitHub](https://github.com/NapthaAI/naptha-sdk/issues) |
| 172 | + |
0 commit comments