Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@huggingface/space-header

Package Overview
Dependencies
Maintainers
0
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

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
130
increased by14.04%
Maintainers
0
Weekly downloads
 
Created
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

Package last updated on 03 Sep 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