Starting the client
To interact with the Featurestore, you need to authenticate first.
Using the H2O Feature Store Client
If you are using the client from within a private Notebook Engine, your environment is already configured.
- Python
import h2o_featurestore
clients = h2o_featurestore.login()
Using the H2O Feature Store Client with PATS
PATs let you authenticate without storing refresh tokens locally (ideal for automation). First generate a PAT (see authentication section) then pass it:
- Python
import h2o_featurestore
h2o_featurestore.login_pat("https://example.com", pat_token="example-pat-token")
Using the H2O CLI
On your local machine, the recommended way is to download and configure the H2O CLI. Visit the CLI & API Access section of H2O AI Cloud to get started.
- Python
import h2o_featurestore
clients = h2o_featurestore.login()
Non‑standard configuration file location:
- Python
import h2o_featurestore
clients = h2o_featurestore.login(config_path="/path/to/h2o-cli-config.toml")
Using the Platform Token
Log in to the H2O AI Cloud and visit the CLI & API Access section. This page will allow you to generate a platform token and provide a code example for you.
In a Wave App
Production (Wave ≥ 0.25.2)
Use q.run for async execution and automatic token refresh via q.auth.ensure_fresh_token_sync:
- Python
from h2o_wave import app, Q, main
import h2o_featurestore
@app('/')
async def serve(q: Q):
clients = await q.run(
h2o_featurestore.login,
token_provider=q.auth.ensure_fresh_token_sync,
)
# use clients here
Production (older Wave versions)
Manually build a token provider with h2o_authn.TokenProvider:
- Python
import os
from h2o_wave import app, Q
import h2o_featurestore, h2o_authn
@app('/')
async def serve(q: Q):
provider = await q.run(
h2o_authn.TokenProvider,
refresh_token=q.auth.refresh_token,
issuer_url=os.getenv("H2O_WAVE_OIDC_PROVIDER_URL"),
client_id=os.getenv("H2O_WAVE_OIDC_CLIENT_ID"),
client_secret=os.getenv("H2O_WAVE_OIDC_CLIENT_SECRET"),
)
clients = await q.run(h2o_featurestore.login, token_provider=provider)
The client configuration is stored by default in the user's home directory. You can change this location by setting the FEATURESTORE_USER_CONFIG environmental variable to the desired location before starting the client.
Development
For a local development of Wave apps, follow the Using the H2O CLI instructions above.
Custom
Use for advanced/off‑cloud deployments where you supply OIDC parameters explicitly:
- Python
clients = h2o_featurestore.login_custom(
endpoint="https://featurestore.cloud-dev.h2o.ai",
refresh_token="my-secret-refresh-token",
client_id="oidc-app-client-id",
client_secret="oidc-app-secret",
issuer_url="https://auth.cloud-dev.h2o.ai/auth/realms/hac-dev"
)
Using Self Signed Certificates
- Python
clients = h2o_featurestore.login(config_path="/path/to/h2o-cli-config.toml", verify_ssl=True, ssl_ca_cert="certificate-path")
- Python
clients = h2o_featurestore.login(verify_ssl=False)
Obtaining Version
Both client and server versions are printed on creation. You can explicitly fetch them:
- Python
clients.get_version()
Open Web UI
Launch the Feature Store Web UI for quick inspection:
- Python
clients.open_website()
- Submit and view feedback for this page
- Send feedback about H2O Feature Store to cloud-feedback@h2o.ai