> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spark.money/llms.txt
> Use this file to discover all available pages before exploring further.

# Breez

> Add self-custodial Lightning and Spark payments with Breez SDK.

export const Button = ({href, children, className = "", target = "_self", outline}) => {
  return <a href={href} target={target} rel="noopener noreferrer" className={`not-prose inline-flex items-center justify-center px-3 py-1.5 text-sm font-medium rounded-xl transition-colors duration-200 ${outline ? "spark-button-outline" : "spark-button"} ${className}`}>
      {children}
    </a>;
};

export const HCard = ({icon, light, dark, href, title, description, target = "_self"}) => {
  return <div className="spark-card rounded-2xl flex justify-center items-center p-4 hover:scale-[1.02] transition-all duration-300">
      <a href={href} target={target} rel={target === "_blank" ? "noopener noreferrer" : undefined} className="w-full">
        <div className="hcard-row" style={{
    display: 'flex',
    flexDirection: 'row',
    alignItems: 'center',
    gap: '1rem'
  }}>
          <div className="hcard-icon" style={{
    flexShrink: 0,
    width: '40px',
    height: '40px'
  }}>
            {light && dark ? <>
                <img src={light} className="icon-light pointer-events-none" alt={title} width={40} height={40} style={{
    width: '40px',
    height: '40px',
    margin: 0
  }} />
                <img src={dark} className="icon-dark pointer-events-none" alt={title} width={40} height={40} style={{
    width: '40px',
    height: '40px',
    margin: 0
  }} />
              </> : <img src={icon} className="pointer-events-none" alt={title} width={40} height={40} style={{
    width: '40px',
    height: '40px',
    margin: 0
  }} />}
          </div>
          <div className="hcard-text" style={{
    display: 'flex',
    flexDirection: 'column',
    gap: '0.5rem'
  }}>
            <h2 className="card-title text font-semibold leading-none" style={{
    margin: 0
  }}>
              {title}
            </h2>
            <p className="card-description text-sm leading-none" style={{
    margin: 0
  }}>
              {description}
            </p>
          </div>
        </div>
      </a>
    </div>;
};

export const VCard = ({img, light, dark, icon, href, title, description, target = "_self"}) => {
  return <div className="spark-card overflow-hidden rounded-2xl flex justify-center items-center hover:scale-[1.02] transition-all duration-300">
      <a href={href} target={target} rel={target === "_blank" ? "noopener noreferrer" : undefined} className="w-full">
        <div className="vcard-col">
          <div className="vcard-image w-full aspect-video relative">
            {light && dark ? <>
                <img src={light} alt={title} className="icon-light w-full h-full object-cover pointer-events-none" />
                <img src={dark} alt={title} className="icon-dark w-full h-full object-cover pointer-events-none" />
              </> : <div className="w-full h-full bg-cover bg-center bg-no-repeat" style={{
    backgroundImage: `url(${img})`
  }} />}
          </div>
          <div className="vcard-content flex flex-col gap-2 p-6">
            <h2 className="card-title text font-semibold leading-none">
              {title}
            </h2>
            <p className="card-description text-sm leading-tight">
              {description}
            </p>
          </div>
        </div>
      </a>
    </div>;
};

export const Card = ({icon, iconLight, iconDark, href, title, description, target = "_self"}) => {
  return <div className="spark-card rounded-2xl flex justify-center p-4 hover:scale-[1.02] transition-all duration-300">
      <a href={href} target={target} rel={target === "_blank" ? "noopener noreferrer" : undefined} className="w-full">
        <div className="flex flex-col gap-12 justify-space-between">
          <div className="w-8 h-8">
            {iconLight && iconDark ? <>
                <img src={iconLight} className="icon-light w-full h-full pointer-events-none" alt={title} width={32} height={32} />
                <img src={iconDark} className="icon-dark w-full h-full pointer-events-none" alt={title} width={32} height={32} />
              </> : <img src={icon} className="w-full h-full pointer-events-none" alt={title} width={32} height={32} />}
          </div>
          <div className="flex flex-col gap-2">
            <h2 className="card-title text font-semibold leading-tight">
              {title}
            </h2>
            <p className="card-description text-sm leading-tight">
              {description}
            </p>
          </div>
        </div>
      </a>
    </div>;
};

<Frame className="chill">
  <img src="https://mintcdn.com/lightspark/6GkmEepiz4G-CXcN/images/integrations/breez.png?fit=max&auto=format&n=6GkmEepiz4G-CXcN&q=85&s=3070192fa0bfeb083d92f9397b16ae3c" alt="Partner" width="1920" height="1080" data-path="images/integrations/breez.png" />
</Frame>

Breez is a fully featured Lightning SDK that lets developers add self-custodial Lightning and Spark payments to their apps with almost zero lift.

If you want to integrate LNURL, Lightning Addresses, or Nostr support, Breez gives you everything in one place. It also includes bindings for all major languages and frameworks, making it the easiest and most complete way to build on Lightning today.

<Button href="https://breez.technology/" outline target="_blank">
  Learn more ->
</Button>

***

## Features

<Columns cols="3" className="gap-4 chill">
  <Card title="Lightning Payments" iconLight="/icons/icon-lightning-black.svg" iconDark="/icons/icon-lightning-white.svg" description="Full Lightning support without running a Lightning node." />

  <Card title="Universal Payment UX" iconLight="/icons/icon-btc-black.svg" iconDark="/icons/icon-btc-white.svg" description="Bolt11, LNURL-Pay, Lightning addresses, BTC addresses, Spark addresses, BTKN; all out of the box" />

  <Card title="Self-Custody by Default" iconLight="/icons/icon-key-black.svg" iconDark="/icons/icon-key-white.svg" description="Keys stay on the user’s device. SDK handles everything else (restore, sync, claims, persistence)." />
</Columns>

***

The SDK is written in Rust with bindings for all major languages (JS, Kotlin, Swift, Go, Python, RN, Flutter, C#). Here's how to integrate it in your app.

## Installation

```bash theme={null}
npm install @breeztech/breez-sdk-spark
```

## Quick Integration

<Tabs>
  <Tab title="Web">
    When developing a browser application, import from `@breeztech/breez-sdk-spark/web`. You must initialize the WebAssembly module with `await init()` before making any other calls.

    ```javascript theme={null}
    import init, {
      initLogging,
      defaultConfig,
      SdkBuilder,
    } from "@breeztech/breez-sdk-spark/web";

    // Initialise the WebAssembly module
    await init();
    ```
  </Tab>

  <Tab title="Node.js">
    When developing a Node.js application (v22+), import from `@breeztech/breez-sdk-spark/nodejs`.

    ```javascript theme={null}
    const {
      initLogging,
      defaultConfig,
      SdkBuilder,
    } = require("@breeztech/breez-sdk-spark/nodejs");
    const { Command } = require("commander");
    require("dotenv").config();

    class JsLogger {
      log = (logEntry) => {
        console.log(
          `[${new Date().toISOString()} ${logEntry.level}]: ${logEntry.line}`
        );
      };
    }

    const fileLogger = new JsLogger();

    class JsEventListener {
      onEvent = (event) => {
        fileLogger.log({
          level: "INFO",
          line: `Received event: ${JSON.stringify(event)}`,
        });
      };
    }

    const eventListener = new JsEventListener();

    const program = new Command();

    const initSdk = async () => {
      // Set the logger to trace
      await initLogging(fileLogger);

      // Get the mnemonic
      const mnemonic = process.env.MNEMONIC;

      // Connect using the config
      let config = defaultConfig("regtest");
      config.apiKey = process.env.BREEZ_API_KEY;
      console.log(`defaultConfig: ${JSON.stringify(config)}`);

      let sdkBuilder = SdkBuilder.new(config, {
        type: "mnemonic",
        mnemonic: mnemonic,
      });
      sdkBuilder = await sdkBuilder.withDefaultStorage("./.data");
      const sdk = await sdkBuilder.build();

      await sdk.addEventListener(eventListener);
      return sdk;
    };

    program
      .name("breez-sdk-spark-wasm-cli")
      .description("CLI for Breez SDK Spark - Wasm");

    program.command("get-info").action(async () => {
      const sdk = await initSdk();
      const res = await sdk.getInfo({});
      console.log(`getInfo: ${JSON.stringify(res)}`);
    });

    program.parse();
    ```
  </Tab>
</Tabs>

***

## Documentation

<Columns cols="1">
  <HCard title="Breez Official Docs" icon="/icons/icon-app-breez.svg" description="Fully-featured Lightning SDK" href="https://sdk-doc-spark.breez.technology/" target="_blank" />
</Columns>
