Greetings ! - i have self-hosted "oryd/kratos:v0.1...
# ory-selfhosting
b
Greetings ! - i have self-hosted "oryd/kratos:v0.11.0" in my local machine. when i try to run sample self-service application "kratos-selfservice-ui-node" from https://github.com/ory/kratos-selfservice-ui-node, by default it is connection to 'https://playground.projects.oryapis.com' instead of locally installed to kratos instance.. even if i hard code "basePath" with value of localhost kratos as below
let sdk = new V0alpha2Api(
new Configuration({
basePath: '<http://127.0.0.1:4434>',
// accessToken: "Your Ory Cloud API Key / Personal Access Token"
}),
)
am i doing correctly or should i do develop my own sdk to connect to locally hosted kratos.. kindly help..
r
Hey mate, we found that we needed to provide the basePath on every request:
Copy code
import getConfig from "next/config";

const getKratosOptions = () => {
	const { serverRuntimeConfig } = getConfig();

	return {
		baseURL: serverRuntimeConfig.BASE_URL,
	};
};

// then you can see we passed it into the options parameter

await ory.submitSelfServiceLoginFlow(flowId, undefined, values, getKratosOptions());
the ory team might have a better solution
w
Hello there 🙂 Afaik it can be set using envs, like we do here: https://github.com/ory/k8s/tree/master/helm/charts/kratos-selfservice-ui-node