Skip to content

Commit 313f115

Browse files
add signup docs
1 parent 7311fe3 commit 313f115

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,49 @@ print(success)
206206

207207
This will return `True` if the file was successfully deleted, or `False` if there was an error.
208208

209+
### Sign Up
210+
211+
The `Signup` module provides methods for signing up to SonicBit.
212+
213+
#### Sign Up
214+
215+
To sign up to SonicBit, you can use the `signup` method:
216+
217+
```python
218+
def otp_callback(email):
219+
return input(f"Enter OTP for {email}: ")
220+
221+
success = SonicBit.signup("John Doe", "email@example.com", "password", otp_callback)
222+
print(success)
223+
```
224+
225+
This will return `True` if the signup was successful, or `False` if there was an error.
226+
227+
> [!NOTE]
228+
> If `otp_callback` is provided the `signup` method will automatically complete the signup process by submitting the OTP code and skipping tutorial. If `otp_callback` is not provided, the user will need to manually complete the signup process by submitting the OTP code and skipping tutorial. Once signup is complete, the user can use the `submit_otp` method to submit the OTP code.
229+
230+
#### Submit OTP
231+
232+
To submit the OTP code, you can use the `submit_otp` method:
233+
234+
```python
235+
success = SonicBit.submit_otp("123456")
236+
print(success)
237+
```
238+
239+
This will return `True` if the OTP code was successfully submitted, or `False` if there was an error.
240+
241+
#### Complete Signup Tutorial (Optional)
242+
243+
To complete the signup tutorial, you can use the `_complete_tutorial` method:
244+
245+
```python
246+
SonicBit._complete_tutorial("token")
247+
```
248+
249+
This will mark the tutorial as completed and allow the user to access their account.
250+
251+
209252
## Contributing
210253

211254
Contributions are welcome! If you find a bug or have a suggestion for a new feature, please open an issue or submit a pull request on the GitHub repository.

0 commit comments

Comments
 (0)