Please provide a step-by-step guide to create a complete JavaScript SDK Application from scratch, including setting up the development environment, selecting appropriate tools and libraries, designing the architecture, implementing the SDK's core features, writing tests, and bundling the application into a single file. The guide should cover best practices for code organization, performance optimization, error handling, security, and maintainability. Additionally, provide code snippets and examples to demonstrate the implementation of key features.

The purpose of your SDK is to provide embedded widgets that can be easily integrated into a publisher's web page, and API wrappers for communicating with external web services.

The development environment should use npm workspaces, vite, vitest for testing framework, vanilla javascript.

The first API is to authenticate using Regular Signin.
Regular sign-in will normally just require either user's email address, member_id or mobile_phone, card_id or username and password.
The endpoint is POST <base_url>/oauth/token
Header Parameter is Accept application/tim
Form Parameters are 
grant_type	string (required)	For regular sign-in, this value should be password
client_id	string (required
client_secret	string (required)
email, integration_id, member_id, card_id, username or mobile_phone	string (required) 
password	string (required)

The response will return 
{
    "access_token": "",
    "token_type": "Bearer",
    "expires_in": 7200,
    "refresh_token": "",
    "create Your response should contain 1000+ words.
user