Skip to content

Commit 40f9a1e

Browse files
Copilotjulien-c
andauthored
[hub] Export HUB_URL constant for consumers (#1489)
This PR exports the `HUB_URL` constant from the hub package so that consumers can directly access it in their applications. ## Changes - Added `export { HUB_URL } from "./consts";` to `packages/hub/src/index.ts` - Added a "Constants" section to the README.md explaining the exported HUB_URL constant and how to use it ## Usage Example ```ts import { HUB_URL } from "@huggingface/hub"; console.log(HUB_URL); // https://huggingface.co // Can be useful when constructing URLs or checking against the default URL const customHubUrl = process.env.CUSTOM_HUB_URL || HUB_URL; ``` This is useful for applications that need to reference the default hub URL or construct hub-related URLs in their code, without having to define the constant themselves. Fixes #1336. > [!WARNING] > > <details> > <summary>Firewall rules blocked me from connecting to one or more addresses</summary> > > #### I tried to connect to the following addresses, but was blocked by firewall rules: > > - `hg.mozilla.org` > - Triggering command: `node ./dist/install.js ` (dns block) > - `hub-ci.huggingface.co` > - Triggering command: `node /home/REDACTED/work/huggingface.js/huggingface.js/node_modules/.bin/../vitest/vitest.mjs run ` (dns block) > - `huggingface.co` > - Triggering command: `node /home/REDACTED/work/huggingface.js/huggingface.js/node_modules/.bin/../vitest/vitest.mjs run ` (dns block) > > If you need me to access, download, or install something from one of these locations, you can either: > > - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled > - Add the appropriate URLs or hosts to my [firewall allow list](https://gh.io/copilot/firewall-config) > > </details> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: julien-c <326577+julien-c@users.noreply.github.com>
1 parent 7cd79cd commit 40f9a1e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/hub/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export type {
1818
SpaceStage,
1919
} from "./types/public";
2020
export { HubApiError, InvalidApiResponseFormatError } from "./error";
21+
export { HUB_URL } from "./consts";
2122
/**
2223
* Only exported for E2Es convenience
2324
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy