# Getting Started The Breez SDK enables mobile developers to integrate Lightning and bitcoin payments into their apps with a very shallow learning curve. The use cases are endless – from social apps that want to integrate tipping between users to content-creation apps interested in adding bitcoin monetization. Crucially, this SDK is an end-to-end, non-custodial, drop-in solution powered by Greenlight, a built-in LSP, on-chain interoperability, third-party fiat on-ramps, and other services users and operators need. The Breez SDK provides the following services: * Sending payments (via various protocols such as: bolt11, keysend, lnurl-pay, lightning address, btc address, etc.) * Receiving payments (via various protocols such as: bolt11, lnurl-withdraw, btc address, etc.) * Fetching node status (e.g. balance, max allow to pay, max allow to receive, on-chain balance, etc.) * Connecting to a new or existing node. Connecting to a node requires a seed (your master key). The seed is a bip39 mnemonic. ## Pricing The Breez SDK is free for developers. ## API Key and Invite Code Before you start, you will need an API Key to use the SDK, as well as an Invite Code when you create a new node. To get both of them, please contact Breez via email at or at ## Support Join this [telegram group](https://t.me/breezsdk) or email us at . ## Installing Breez SDK is available in several platforms. Follow the [Installing](install.md) page for instructions on how to install on your platform. ## Connecting The first step is to construct the SDK configuration. In it the environment and Greenlight node configuration is defined, whether you are using an invite code or partner credentials. The SDK uses the config working directory to store the state of the SDK instance. Once a connection has been established with a node, the working directory can only be used for that node. When handling multiple instances of the SDK, one per node, each needs to have a different working directory defined. Now you are ready to interact with the SDK.
Rust
```rust,ignore {{#include ../../snippets/rust/src/getting_started.rs:init-sdk}} ```
Swift
```swift,ignore // SDK events listener class SDKListener: EventListener { func onEvent(e: BreezEvent) { print("received event ", e) } } // Create the default config let seed = try mnemonicToSeed(phrase: "") let inviteCode = "" let apiKey = "" let config = breez_sdk.defaultConfig(envType: EnvironmentType.production, apiKey: apiKey, nodeConfig: NodeConfig.greenlight( config: GreenlightNodeConfig(partnerCredentials: nil, inviteCode: inviteCode))); // Customize the config object according to your needs config.workingDir = "path to an existing directory" do { // Connect to the Breez SDK make it ready for use let sdk = try connect(config: config, seed: seed, listener: SDKListener()); } catch{ // handle error } ```
Kotlin
```kotlin,ignore // SDK events listener class SDKListener : EventListener { override fun onEvent(e: BreezEvent) { Log.v("SDKListener", "Received event $e") } } // Select your seed, invite code and eviroment val seed = mnemonicToSeed("") val inviteCode = "" val apiKey = "" // Create the default config val greenlightNodeConfig = GreenlightNodeConfig(null, inviteCode) val nodeConfig = NodeConfig.Greenlight(greenlightNodeConfig) val config = defaultConfig(EnvironmentType.PRODUCTION, apiKey, nodeConfig) // Customize the config object according to your needs config.workingDir = "path to an existing directory" try { // Connect to the Breez SDK make it ready for use val sdk = connect(config, seed, SDKListener()) } catch (e: Exception) { // handle error } ```
React Native
```typescript {{#include ../../snippets/react-native/getting_started.ts:init-sdk}} ```
Dart
```dart,ignore {{#include ../../snippets/dart_snippets/lib/getting_started.dart:init-sdk}} ```
Python
```python,ignore # SDK events listener class SDKListener(breez_sdk.EventListener): def on_event(self, event): print(event) # Create the default config seed = mnemonic_to_seed("") invite_code = "" api_key = "" config = breez_sdk.default_config(breez_sdk.EnvironmentType.PRODUCTION, apiKey, breez_sdk.NodeConfig.GREENLIGHT(breez_sdk.GreenlightNodeConfig(None, invite_code))) # Customize the config object according to your needs config.working_dir = "path to an existing directory" try: # Connect to the Breez SDK make it ready for use sdk_services = breez_sdk.connect(config, seed, SDKListener()) except Exception as error: # Handle error ```
Go
```go,ignore {{#include ../../snippets/go/getting_started.go:init-sdk}} ```
C#
```cs,ignore {{#include ../../snippets/csharp/GettingStarted.cs:init-sdk}} ```
At any point we can fetch our balance from the Greenlight node:
Rust
```rust,ignore {{#include ../../snippets/rust/src/getting_started.rs:fetch-balance}} ```
Swift
```swift,ignore do { let nodeInfo = try sdk.nodeInfo() let lnBalance = nodeInfo?.channelsBalanceMsat let onchainBalance = nodeInfo?.onchainBalanceMsat } catch { // handle error } ```
Kotlin
```kotlin,ignore try { val nodeInfo = sdk.nodeInfo() val lnBalance = nodeInfo?.channelsBalanceMsat val onchainBalance = nodeInfo?.onchainBalanceMsat } catch (e: Exception) { // handle error } ```
React Native
```typescript {{#include ../../snippets/react-native/getting_started.ts:fetch-balance}} ```
Dart
```dart,ignore {{#include ../../snippets/dart_snippets/lib/getting_started.dart:fetch-balance}} ```
Python
```python,ignore try: node_info = node_info() ln_balance = node_info.channels_balance_msat onchain_balance = node_info.onchain_balance_msat except Exception as error: # Handle error ```
Go
```go,ignore {{#include ../../snippets/go/getting_started.go:fetch-balance}} ```
C#
```cs,ignore {{#include ../../snippets/csharp/GettingStarted.cs:fetch-balance}} ```
You are now ready to receive a Lightning [payment](payments.md).