Profiles class
Multi-account / multi-tailnet support: one node with several saved login profiles. Switching changes which tailnet this node is a member of without re-authenticating from scratch. Useful for a single app that needs to operate in both a personal and a work tailnet, or dev vs prod.
Mirrors the profile-management surface of the tailscale CLI —
see tailscale.com/kb/1331/login-profiles for the
end-user-facing concept.
Reached via Tailscale.profiles.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
current(
) → Future< LoginProfile?> - The currently active profile, or null if no profile is active on this node (e.g. the node has never logged in).
-
delete(
LoginProfile profile) → Future< void> - Removes a profile and its persisted credentials.
-
deleteById(
String profileId) → Future< void> - Escape hatch for deleting by stable profile ID.
-
list(
) → Future< List< LoginProfile> > - All profiles saved on this node.
-
newEmpty(
) → Future< void> - Creates an empty profile slot. The next Tailscale.up with a fresh authkey registers a new node under this slot without touching other profiles.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
switchTo(
LoginProfile profile) → Future< void> -
Switches to
profile. The engine disconnects from the current tailnet and connects with the target profile's credentials. -
switchToId(
String profileId) → Future< void> - Escape hatch for switching by stable profile ID — useful when the caller has persisted an ID across sessions and doesn't have the full LoginProfile handy.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited