Let $A_0$ be a finite dimensional $k$-algebra where $k$ is an algebraically closed field of characteristic $p$ not necessarily with unit. We wish to show there is a $k$-algebra $A$ with a unit $1$ containing $A_0$ as a $k$-subalgebra of $A$ of co-dimension $1$.
Attempt
Let $\{b_1,\dots,b_n\}$ be a $k$-basis of $A_0$. Formally define $A$ to be the $k$-span of $$\{b_1,\dots,b_n\} \cup \{1\}$$ where we define $$a_0 \cdot 1 = 1 \cdot a_0 = a_0 \tag{$\forall a_0 \in A_0$}$$ and $$k \cdot 1 = \underbrace{1+\dots+1}_{k \text{ times}}$$ Then it is clear that $A_0$ is a subalgebra.
Confusion
There is a mapping of $k$ into the center of $A_0$ and so I can think of elements of $k$ in $A$, although not every element of $k$ is uniquely embedded in $A_0$. So, any $s \in k$ should be in the $k$-span of $\{b_1,\dots,b_n\}$ so whether or not my algebra $A$ is actually well-defined and whether or not $A_0$ would be of codimension $1$ seems unclear as the expression of every element should be unique. Clearly, I am losing some inuition somewhere in the definition of an algebra. Clarification would be greatly appreciated.
Follow Up Question:
I didn't use anything but finite dimensionality so I presume this holds in the much more general case of an algebra over a commutative ring $R$ where our algebra is finite dimensional over $R$?
I think the most natural idea is to take the unitization $A^1=k\times A_0$ where addition is defined to be $(\alpha, a)+(\beta, b)=(\alpha+\beta, a+b)$ and multiplication is defined $(\alpha, a)(\beta, b)=(\alpha\beta, \alpha b+\beta a+ab)$, where the identity will be $(1,0)$, and $A_0$ is embedded as the subalgebra $\{(0,a)\mid a\in A_0\}$.
I don't find your description of the algebra in the attempt very clear, but what I am describing is much like that.
It has nothing to do with finite dimensionality of $A_0$ or algebraic closedness or characteristic of $k$.