Socket
Socket
Sign inDemoInstall

@huggingface/space-header

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@huggingface/space-header

Use the Space mini_header outside Hugging Face


Version published
Maintainers
4
Created
Source

🤗 Hugging Face Space Header

A Typescript powered wrapper for the Space mini_header feature.

Install

pnpm add @huggingface/space-header

npm add @huggingface/space-header

yarn add @huggingface/space-header

Deno

// esm.sh
import { init } from "https://esm.sh/@huggingface/space-header"
// or npm:
import { init } from "npm:@huggingface/space-header"

Initialize

import { init } from "@huggingface/space-header";

// ...

init(":user/:spaceId");
// init("enzostvs/lora-studio") for example

❗Important note: The init method must be called on the client side.

Usage

Uses the target option to inject the space-header into another DOM element

const app = document.getElementById("app");

// ...

init(":user/:spaceId", {
  target: app
});

If you already have the space data, you can also pass it as a parameter to avoid a fetch

init(space);

// space = {
//  id: string;
//  likes: number;
//  author: string;
// }

FAQs

Package last updated on 18 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc