Socket
Socket
Sign inDemoInstall

@huggingface/space-header

Package Overview
Dependencies
0
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@huggingface/space-header


Version published
Weekly downloads
5
decreased by-93.59%
Maintainers
0
Created
Weekly downloads
 

Readme

Source

🤗 Hugging Face Space Header

A Typescript powered wrapper for the Space mini_header feature.

space header preview

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;
// }

Keywords

FAQs

Last updated on 25 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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc