# Introduction

## Why ?

When I start to make SPA and API with rails, a lot of tutorial is using&#x20;

**"jwt" : "json web token"**

But, if you are using devise, the option for api is ...&#x20;

* [Devise Token Auth](https://github.com/lynndylanhurley/devise_token_auth)
* [Simple Token Authentication](https://github.com/gonzalo-bulnes/simple_token_authentication)
* [Tiddle](https://github.com/adamniedzielski/tiddle)
* Make sure to read [this gist by José Valim](https://gist.github.com/josevalim/fb706b1e933ef01e4fb6) if you want to implement token authentication yourself.

[**https://github.com/plataformatec/devise/wiki/How-To:-Simple-Token-Authentication-Example**](https://github.com/plataformatec/devise/wiki/How-To:-Simple-Token-Authentication-Example)

***Neither of them uses "jwt" !***

That's why I'm confused...&#x20;

#### *"what is the best way to implement the authentication for rails api ?"*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kohhepeace.gitbook.io/rails-authentication-guide/introduction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
