Migration Overview

The Request Network SDK has been deprecated in favor of the more robust and feature-rich Request Network API. This guide provides a straightforward migration path for the few existing SDK users.
SDK Deprecation NoticeThe Request Network SDK had near-zero adoption and is no longer maintained. All new development should use the Request Network API.

Quick Migration Summary

From SDK to API:
  • Replace direct blockchain interactions with API calls
  • Simplified authentication using API keys
  • Enhanced features including webhooks and advanced payment types
  • Better error handling and rate limiting
  • Comprehensive documentation and support

Migration Steps

1

Get API Keys

Sign up for Request Network API access at portal.request.network
2

Replace SDK Calls

Convert SDK function calls to equivalent API endpoints
3

Update Error Handling

Implement proper API error handling and retry logic
4

Add Webhooks

Set up webhooks for real-time payment notifications

Code Comparison

Request Creation

import { RequestNetwork } from '@requestnetwork/request-client.js';

// SDK approach - deprecated
const requestNetwork = new RequestNetwork({
  nodeConnectionConfig: {
    baseURL: 'https://goerli.gateway.request.network/'
  }
});

const request = await requestNetwork.createRequest({
  requestInfo: {
    currency: 'ETH',
    expectedAmount: '1000000000000000000',
    payee: {
      type: 'ethereumAddress',
      value: '0x...'
    }
  }
});

Payment Processing

// SDK payment processing
const paymentTx = await request.payWithWallet(wallet);
await paymentTx.wait();

Benefits of API Migration

🚀 Simplified Integration

Easier Development:
  • No blockchain wallet management required
  • Standard REST API calls
  • Comprehensive error responses
  • Built-in rate limiting and retry logic

🔔 Real-time Updates

Enhanced Monitoring:
  • Webhook notifications for all events
  • Real-time payment confirmations
  • Automatic retry for failed webhooks
  • Comprehensive event logging

⚙️ Advanced Features

New Capabilities:
  • Cross-chain payments
  • Batch processing
  • Recurring payments
  • Platform fee collection
  • Multi-currency support

🛡️ Enterprise Ready

Production Features:
  • High availability and uptime
  • Scalable infrastructure
  • Professional support
  • Security audits and compliance

Common Migration Patterns

Replace SDK Initialization

import { RequestNetwork } from '@requestnetwork/request-client.js';
import { Web3SignatureProvider } from '@requestnetwork/web3-signature';

const web3SignatureProvider = new Web3SignatureProvider(web3.currentProvider);
const requestNetwork = new RequestNetwork({
  nodeConnectionConfig: {
    baseURL: 'https://goerli.gateway.request.network/'
  },
  signatureProvider: web3SignatureProvider
});

Replace Event Listening

// SDK event listening
request.on('payment', (payment) => {
  console.log('Payment received:', payment);
  updateOrderStatus(payment.requestId, 'paid');
});

Migration Checklist

Need Help?

Limited SDK SupportSince the SDK had minimal adoption, migration support is available on a case-by-case basis. Most users will find the API migration straightforward and beneficial.