YouTube.js
Guide
Discord
GitHub
Guide
Discord
GitHub
    • Introduction
    • Getting Started
    • Browser Usage
    • Caching
    • Proxies
    • Authentication
    • Advanced Usage
    • Troubleshooting
    • FAQ

Proxies

You may provide your own fetch implementation to be used by YouTube.js. This can be useful in some cases to modify the requests before they are sent and transform the responses before they are returned (eg. for proxies).

// provide a fetch implementation
const yt = await Innertube.create({
  fetch: async (input: RequestInfo | URL, init?: RequestInit) => {
    // make the request with your own fetch implementation
    // and return the response
    return new Response(
      /* ... */
    );
  }
});
Edit this page
Last Updated:: 3/25/25, 8:08 PM
Contributors: EdamAme-x
Prev
Caching
Next
Authentication