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

# Quickstart

> Send and verify a code in 2 minutes and 3 simple steps with our SDKs, available for Node.js, Python, and Go.

# Get the Backend SDK

We provide backend SDKs for Node.js, Python, Go, Kotlin/Java and Ruby to make your life easier.

<CodeGroup>
  ```bash Node.js theme={null}
  npm add @prelude.so/sdk
  ```

  ```bash Python theme={null}
  pip install prelude_python_sdk
  ```

  ```bash Go theme={null}
  go get github.com/prelude-so/go-sdk
  ```

  ```gradle Java Gradle theme={null}
  implementation("so.prelude.sdk:prelude-java:0.2.0")
  ```

  ```xml Java Maven theme={null}
  <dependency>
      <groupId>so.prelude.sdk</groupId>
      <artifactId>prelude-java</artifactId>
      <version>0.2.0</version>
  </dependency>
  ```
</CodeGroup>

<sub>
  Want to see another language make its way to the list? [Tell
  us](mailto:support@prelude.so)
</sub>

# Initialize the SDK

Initialize the SDK by pasting the snippet below.

<Info>
  Get your `API_KEY` from the **All Services > Configure > Keys** page of the [Prelude dashboard](https://app.prelude.so).
</Info>

<CodeGroup>
  ```typescript Node.js theme={null}
  import Prelude from "@prelude.so/sdk";

  const client = new Prelude({
    apiToken: "API_KEY",
  });
  ```

  ```python Python theme={null}
  from prelude_python_sdk import Prelude

  client = Prelude(
    api_token="API_KEY",
  )
  ```

  ```go Go theme={null}
  package main

  import (
  	"github.com/prelude-so/go-sdk"
  )

  func main() {
  	client := prelude.NewClient(
      option.WithAPIToken("API_KEY")
    )
  }
  ```

  ```java Java theme={null}
    import so.prelude.sdk.client.PreludeClient;
    import so.prelude.sdk.client.okhttp.PreludeOkHttpClient;

    // Configures using the `API_TOKEN` environment variable
    PreludeClient client = PreludeOkHttpClient.fromEnv();
  ```
</CodeGroup>

# Send a code

Call the [Create Verification](/verify/v2/api-reference/create-or-retry-a-verification) endpoint to send a verification code to a phone number. You will receive a code by SMS.

<CodeGroup>
  ```typescript Node.js theme={null}
  import Prelude from "@prelude.so/sdk";

  const client = new Prelude();

  async function main() {
    const verification = await client.verification.create({
      target: {
        type: "phone_number",
        value: "+30123456789",
      },
      // Optional signals dispatchId value, captured in the frontend SDKs
      dispatch_id: "client dispatchId",
    });

    console.log(verification.id);
  }

  main();
  ```

  ```python Python theme={null}
  import os
  from prelude_python_sdk import Prelude

  client = Prelude()

  verification = client.verification.create(
      target={
          "type": "phone_number",
          "value": "+30123456789",
      },
      # Optional signals dispatchId value, captured in the frontend SDKs
      dispatch_id: "client dispatchId",
  )

  print(verification.id)
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"

  	"github.com/prelude-so/go-sdk"
  	"github.com/prelude-so/go-sdk/option"
  )

  func main() {
  	client := prelude.NewClient()

  	verification, err := client.Verification.New(context.TODO(), prelude.VerificationNewParams{
  		Target: prelude.F(prelude.VerificationNewParamsTarget{
  			Type:  prelude.F(prelude.VerificationNewParamsTargetTypePhoneNumber),
  			Value: prelude.F("+30123456789"),
  		}),
  		// Optional signals dispatchId value, captured in the frontend SDKs
  		DispatchID: "client dispatchId",
  	})
  	if err != nil {
  		panic(err.Error())
  	}

  	fmt.Printf("%+v\n", verification.ID)
  }
  ```

  ```java Java theme={null}
   import so.prelude.sdk.client.PreludeClient;
   import so.prelude.sdk.client.okhttp.PreludeOkHttpClient;
   import so.prelude.sdk.models.VerificationCreateParams;
   import so.prelude.sdk.models.VerificationCreateResponse;

   // Configures using the `API_TOKEN` environment variable
   PreludeClient client = PreludeOkHttpClient.fromEnv();

   VerificationCreateParams params = VerificationCreateParams.builder()
       .target(VerificationCreateParams.Target.builder()
           .type(VerificationCreateParams.Target.Type.PHONE_NUMBER)
           .value("+30123456789")
           .build())
       // Optional signals dispatchId value, captured in the frontend SDKs
       .dispatchId("client dispatchId")
       .build();
   VerificationCreateResponse verification = client.verification().create(params);
  ```
</CodeGroup>

# Verify the code

Call the [Check](/verify/v2/api-reference/check-a-code) endpoint with the same phone number and the code you received.

<CodeGroup>
  ```typescript Node.js theme={null}
  import Prelude from "@prelude.so/sdk";

  const client = new Prelude();

  async function main() {
    const check = await client.verification.check({
      target: {
        type: "phone_number",
        value: "+30123456789",
      },
      code: "123456",
    });

    console.log(check.id);
  }

  main();
  ```

  ```python Python theme={null}
  import os
  from prelude_python_sdk import Prelude

  client = Prelude()

  check = client.verification.check(
    target={
      "type": "phone_number",
      "value": "+30123456789",
    },
    code="123456",
  )

  print(check.id)
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"

  	"github.com/prelude-so/go-sdk"
  	"github.com/prelude-so/go-sdk/option"
  )

  func main() {
  	client := prelude.NewClient()

  	check, err := client.Verification.Check(context.TODO(), prelude.VerificationCheckParams{
  		Target: prelude.F(prelude.VerificationCheckParamsTarget{
  			Type:  prelude.F(prelude.VerificationCheckParamsTargetTypePhoneNumber),
  			Value: prelude.F("+30123456789"),
  		}),
  		Code: prelude.F("123456"),
  	})
  	if err != nil {
  		panic(err.Error())
  	}

  	fmt.Printf("%+v\n", check.ID)
  }
  ```

  ```java Java theme={null}
    import so.prelude.sdk.client.PreludeClient;
    import so.prelude.sdk.client.okhttp.PreludeOkHttpClient;
    import so.prelude.sdk.models.VerificationCheckParams;
    import so.prelude.sdk.models.VerificationCheckResponse;

    // Configures using the `API_TOKEN` environment variable
    PreludeClient client = PreludeOkHttpClient.fromEnv();

    VerificationCheckParams params = VerificationCheckParams.builder()
        .target(VerificationCheckParams.Target.builder()
            .type(VerificationCheckParams.Target.Type.PHONE_NUMBER)
            .value("+30123456789")
            .build())
        .code("123456")
        .build();
    VerificationCheckResponse verification = client.verification().check(params);
  ```
</CodeGroup>

<div style={{ marginTop: 40 }}>
  <Check>
    Congratulations, you've just integrated Prelude! Now, you can go to the
    [Dashboard](https://app.prelude.so) and see your verification codes in the **Verifications**
    tab.
  </Check>
</div>

***

# Going further

Here are a few more steps before moving on to production:

<Steps>
  <Step title="Test your integration">
    To make sure your integration is correct, use [test
    numbers](/verify/v2/documentation/testing) in your automated tests. Add them in the
    **Verify API > Configure > Numbers** tab.
  </Step>

  <Step title="Add fraud signals">
    Add [Signals](/verify/v2/documentation/prevent-fraud#signals) such as `ip`,
    `device_id` and `device_model` to your
    [Verification](/verify/v2/api-reference/create-or-retry-a-verification) requests to better prevent
    fraud and reduce your expenses.
  </Step>
</Steps>

***

# Next steps

Get more in-depth with our guides to prepare your integration for production:

<CardGroup>
  <Card title="Verification Lifecycle" href="/verify/v2/documentation/lifecycle" icon="arrow-progress">
    Understand the verification lifecycle and how it allows you to build a fully-functional verification flow in your application.
  </Card>

  <Card title="Prevent Fraud" href="/verify/v2/documentation/prevent-fraud" icon="binoculars">
    Prevent fraud and only let real users through.
  </Card>

  <Card title="Message Content" href="/verify/v2/documentation/content" icon="message-pen">
    Learn the various customization options for your verification messages.
  </Card>

  <Card title="Webhook" href="/verify/v2/documentation/webhook" icon="webhook">
    Act on events coming from the Verification API.
  </Card>
</CardGroup>
