Skip to main content

Installation

Solvix can be installed using any modern JavaScript package manager.

It is designed to work seamlessly across multiple runtimes including Node.js, browsers, and edge environments.

Install Solvix

Using npm

npm i @adityadev13/solvix

Using pnpm

pnpm add @adityadev13/solvix

Using yarn

yarn add @adityadev13/solvix

Using bun

bun add @adityadev13/solvix

Environment support

Solvix is runtime-agnostic and works in:

  • Node.js (v18+ recommended)
  • Modern browsers
  • Bun runtime
  • Edge environments (Cloudflare Workers, Vercel Edge)

No environment-specific setup is required.

Module support

Solvix supports modern JavaScript module systems.

import { createClient } from "solvix";

CommonJS (Node.js)

const { createClient } = require("solvix");

TypeScript support

Solvix is written in TypeScript and includes built-in type definitions.

No additional packages are required.

import { createClient } from "solvix";

const client = createClient({
baseURL: "https://api.example.com",
});

Type inference works out of the box.

Verify installation

Create a simple test file:

import { createClient } from "solvix";

const client = createClient({
baseURL: "https://jsonplaceholder.typicode.com",
});

async function test() {
const res = await client.get("/posts");
console.log(res.data);
}

test();

If this runs successfully, Solvix is installed correctly.

Browser usage

Solvix works directly in the browser without additional configuration.

import { createClient } from "solvix";

const client = createClient({
baseURL: "/api",
});

Ensure your environment supports fetch.

Node.js usage

Node.js v18+ includes native fetch, so no polyfills are required.

For older Node versions, you may need a fetch polyfill.

Bundlers and frameworks

Solvix works with:

  • Vite
  • Next.js
  • Webpack
  • Rollup
  • Turbopack

No special configuration is needed.

Best practices

  • Use a single client instance across your application
  • Configure global settings (retry, headers) at client creation
  • Avoid creating a new client per request

Example:

const client = createClient({
baseURL: "https://api.example.com",
retry: { retries: 3 },
});

Troubleshooting

Module not found

Ensure Solvix is installed:

npm install @adityadev13/solvix

Fetch not available

If using older Node.js:

  • Upgrade to Node.js v18+
  • Or install a fetch polyfill

TypeScript errors

Ensure your tsconfig.json includes:

{
"moduleResolution": "node",
"esModuleInterop": true
}

Summary

Solvix installation is simple and requires no complex setup.

It works across environments, supports modern tooling, and is ready for production use immediately after installation.