feature/gresiq-v1
claude/smbcloud-github-app-k9641p
development
feature/apps
feature/build-release
feature/ci-docs
feature/ci-ruby-gems
feature/cicd
feature/completion
feature/dist-nuget
feature/fix-ci-sdk-pypi-rubygem
feature/fix-clippy-on-stable-channel
feature/fix-deployment-script
feature/github-email
feature/gresiq-v1
feature/project-new-structure
feature/rsync-deploy
feature/ruby-runner
feature/sdk-npm
feature/sdk-workflows
feature/smbcloud-cli-release-npm
feature/smbcloud-deploy
feature/wasm
main
release/v0.7.4
| 1 | # smbcloud-auth Gem |
| 2 | |
| 3 | Ruby bindings for the smbCloud Auth SDK. |
| 4 | |
| 5 | ## Install |
| 6 | |
| 7 | ```bash |
| 8 | gem install smbcloud-auth |
| 9 | ``` |
| 10 | |
| 11 | ## Usage |
| 12 | |
| 13 | ```ruby |
| 14 | require "auth" |
| 15 | |
| 16 | client = SmbCloud::Auth::Client.new( |
| 17 | environment: SmbCloud::Auth::Environment::PRODUCTION, |
| 18 | app_id: "app-id", |
| 19 | app_secret: "app-secret" |
| 20 | ) |
| 21 | |
| 22 | signup = client.signup( |
| 23 | email: "name@example.com", |
| 24 | password: "password123" |
| 25 | ) |
| 26 | |
| 27 | login = client.login( |
| 28 | email: "name@example.com", |
| 29 | password: "password123" |
| 30 | ) |
| 31 | |
| 32 | me = client.me(access_token: login[:access_token]) |
| 33 | ``` |
| 34 | |
| 35 | ## API |
| 36 | |
| 37 | `SmbCloud::Auth::Client` exposes: |
| 38 | |
| 39 | - `signup(email:, password:)` |
| 40 | - `login(email:, password:)` |
| 41 | - `me(access_token:)` |
| 42 | - `logout(access_token:)` |
| 43 | - `remove(access_token:)` |
| 44 | |
| 45 | For simple scripting, module-level convenience wrappers are also available: |
| 46 | |
| 47 | - `SmbCloud::Auth.signup_with_client(...)` |
| 48 | - `SmbCloud::Auth.login_with_client(...)` |
| 49 | - `SmbCloud::Auth.me_with_client(...)` |
| 50 | - `SmbCloud::Auth.logout_with_client(...)` |
| 51 | - `SmbCloud::Auth.remove_with_client(...)` |