Modern TypeScript HTTP client for browser and Node.js environments.
- 🚀 Universal: Works in both browser and Node.js
- 🔒 Type Safe: Full TypeScript support with strict typing
- 🛡️ Secure: Built-in security features and authentication
- 🧪 Well Tested: Comprehensive test coverage
- 📦 Zero Config: Works out of the box
- 🔌 Extensible: Multiple authentication methods
pnpm add make-api-request-jsOr with npm:
npm install make-api-request-jsimport { CoreClient } from 'make-api-request-js'; const client = new CoreClient({ baseUrl: 'https://api.example.com' }); // Make a GET request const response = await client.makeRequest({ method: 'get', path: '/users' }); const users = await response.json(); console.log(users);import { CoreClient, AuthBearer } from 'make-api-request-js'; const client = new CoreClient({ baseUrl: 'https://api.example.com', auths: { bearer: new AuthBearer('your-token-here') } }); const response = await client.makeRequest({ method: 'get', path: '/protected', auth: ['bearer'] });import { AuthKey } from 'make-api-request-js'; // Header-based API key const headerAuth = new AuthKey('X-API-Key', 'your-api-key'); // Query parameter API key const queryAuth = new AuthKey('api_key', 'your-api-key', 'query');import { OAuth2ClientCredentials } from 'make-api-request-js'; const oauth = new OAuth2ClientCredentials( 'client-id', 'client-secret', 'https://auth.example.com/token' );# Install dependencies pnpm install # Run tests pnpm test # Run tests with coverage pnpm test:coverage # Build the project pnpm build # Run linting pnpm lint # Format code pnpm format- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE file for details.